A.2.2. Installing and Upgrading

RPM packages typically have file names
like tree-1.5.3-2.fc15.x86_64.rpm. The file name includes the package name (tree), version (1.5.3), release (2), operating system major version (fc15) and CPU architecture (x86_64).

You can use rpm's -U option to:

upgrade an existing but older package on the system to a newer version, or

install the package even if an older version is not already installed.

That is, rpm -U <rpm_file> is able to perform the function of either upgrading or installing as is appropriate for the package.

Assuming the tree-1.5.3-2.fc15.x86_64.rpm package is in the current directory, log in as root and type the following command at a shell prompt to either upgrade or install the tree package as determined by rpm:

rpm -Uvh tree-1.5.3-2.fc15.x86_64.rpm

Use -Uvh for nicely-formatted RPM installs

The -v and -h options (which are combined with -U) cause rpm to print more verbose output and display a progress meter using hash signs.

If the upgrade/installation is successful, the following output is displayed:

Always use the -i (install) option to install new kernel packages!

rpm provides two different options for installing packages: the aforementioned -U option (which historically stands for upgrade), and the -i option, historically standing for install. Because the -U option subsumes both install and upgrade functions, we recommend to use rpm -Uvh with all packages except kernel packages.

You should always use the -i option to simply install a new kernel package instead of upgrading it. This is because using the -U option to upgrade a kernel package removes the previous (older) kernel package, which could render the system unable to boot if there is a problem with the new kernel. Therefore, use the rpm -i <kernel_package> command to install a new kernel without replacing any older kernel packages. For more information on installing kernel packages, refer to Chapter 20, Manually Upgrading the Kernel.

The signature of a package is checked automatically when installing or upgrading a package. The signature confirms that the package was signed by an authorized party. For example, if the verification of the signature fails, an error message such as the following is displayed:

A.2.2.3. Unresolved Dependency

RPM packages may sometimes depend on other packages
, which means that they require other packages to be installed to run properly. If you try to install a package which has an unresolved dependency, output similar to the following is displayed:

If you are installing a package from the Fedora installation media, such as from a CD-ROM or DVD, the dependencies may be available. Find the suggested package(s) on the Fedora installation media or on one of the active Fedora mirrors and add it to the command:

rpm -Uvh foo-1.0-1.fc15.x86_64.rpm bar-3.1.1.fc15.x86_64.rpm

If installation of both packages is successful, output similar to the following is displayed:

You can try the --whatprovides option to determine which package contains the required file.

rpm -q --whatprovides "bar.so.3"

If the package that contains bar.so.3 is in the RPM database, the name of the package is displayed:

bar-3.1.1.fc15.i586.rpm

Warning: Forcing Package Installation

Although we can forcerpm to install a package that gives us a Failed dependencies error (using the --nodeps option), this is not recommended, and will usually result in the installed package failing to run. Installing or removing packages with rpm --nodeps can cause applications to misbehave and/or crash, and can cause serious package management problems or, possibly, system failure. For these reasons, it is best to heed such warnings; the package manager—whether RPM, Yum or PackageKit—shows us these warnings and suggests possible fixes because accounting for dependencies is critical. The Yum package manager can perform dependency resolution and fetch dependencies from online repositories, making it safer, easier and smarter than forcing rpm to carry out actions without regard to resolving dependencies.