Name

rpm

Syntax

rpm -i [options]
(also rpm --install)
rpm -U [options] (also rpm --upgrade)
rpm -e [options] (also rpm --uninstall)
rpm -q [options] (also rpm --query)
rpm -V [options] (also rpm --verify)

Install/upgrade mode

The install mode (rpm -i) is used to install new packages. A variant of install mode is the upgrade mode (rpm -U), where an installed package is upgraded to a more recent version. Another variant is the freshen mode (rpm -F), which upgrades only packages that have an older version already installed on the system. But rpm’s -F option has limited value, since it doesn’t handle dependency changes at all. In other words, if a new version of a package requires that another package be installed, -F won’t automatically install the new package, even if it is listed on the command line.

Frequently used install and upgrade options

--force

Allows the replacement of existing packages and of files from previously installed packages; for upgrades, it allows the replacement of a newer package with an older one. (Literally, it is equivalent to setting all of the options --replacepkgs, --replacefiles, and --oldpackage.) Use this option with caution.

-h (also --hash)

Prints a string of 50 hash marks (#) during installation as a progress indicator.

--nodeps

Allows you to install a package without checking for dependencies. This command should be avoided because it makes the dependency database inconsistent.

--test

Runs through all the motions except for actually writing files; it’s useful ...

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.