O'Reilly logo

Learning Red Hat Linux by Bill McCarty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating a Package

When you update (upgrade) a package, RPM installs the new version of the software but attempts to leave your existing configuration files intact. You can update a package by using the -U switch of the rpm command:

rpm -Uvh package

When you update a package, RPM automatically uninstalls the old version of the package before installing the new one.

Tip

If no old version of the specified package exists, RPM simply installs the new version. Therefore, you can use the -U switch to install or update a package; many Linux users avoid the -i switch, always using the -U switch instead.

If RPM determines that your existing configuration files may be incompatible with those of the new version of the package, RPM will save a copy of the existing files. In such a case, you need to examine the old and new files and determine what the proper configuration should be. The documentation that accompanies the package should assist you in this process.

If you attempt to update an existing package using an older version of the package, RPM will report an error and terminate without performing the update. To force RPM to perform the update, use the --oldpackage switch:

rpm -Uvh --oldpackage package

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required