next up previous contents index
Next: 7.2.4 Querying Up: 7.2 Using RPM Previous: 7.2.2 Uninstalling

7.2.3 Upgrading

 

Upgrading a package is almost just like installing.

$ rpm -Uvh foo-2.0-1.i386.rpm
foo                         ####################################

What you don't see above is the fact that RPM automatically uninstalled any old versions of the foo package. In fact you may want to always use -U to install packages, since it works fine even when there are no previous versions of the package installed.

Since RPM performs intelligent upgrading of packages with configuration files, you may see a message like:

saving /etc/foo.conf as /etc/foo.conf.rpmsave

This means that your changes to the configuration file may not be ``forward compatible'' with the new configuration file in the package, so RPM saved your original file, and installed a new one. You should investigate and resolve the differences between the two files as soon as possible to ensure that your system continues to function properly.

Since upgrading is really a combination of uninstalling and installing, you can encounter any errors from those modes, plus one more: If RPM thinks you are trying to upgrade to a package with an older version number, you will see:

$ rpm -Uvh foo-1.0-1.i386.rpm
foo       package foo-2.0-1 (which is newer) is already installed
error: foo-1.0-1.i386.rpm cannot be installed

To cause RPM to ``upgrade'' anyway, use -oldpackage on the command line.



Red Hat Software