Flylib.com

Books Software

 
 
 

8.6 Uninstalling a Package

8.6 Uninstalling a Package

To uninstall a package, type:


rpm -e


package

In this command, package is the name of the package, not the name of the package file. The name should omit the architecture; it can also omit the package version or package version and release number. For example, you can erase the pine package by issuing either of the following commands:

rpm -e pine-4.44-13
rpm -e pine

If you attempt to uninstall a package on which another package depends, RPM will report a dependency error and terminate without uninstalling the package. You can force RPM to uninstall the package by using the -- nodeps option:


rpm -e --nodeps


package

However, doing so will probably cause the dependent package to cease working properly. Therefore, you shouldn't use the -- nodeps option very often.

8.7 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 option 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.

If no old version of the specified package exists, RPM simply installs the new version. Therefore, you can use the -U option to install or update a package; many Linux users avoid the -i (install) option, always using the -U option instead. However, you should not use the -U option when installing a package containing an updated Linux kernel.

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 that 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 option:


rpm -Uvh --oldpackage


package

8.8 Freshening a Package

From time to time, Red Hat issues updated packages that correct functional or security- related problems with released packages. You can use Red Hat Network, described later in this chapter in Section 8.10, to obtain and install updated packages. However, if you prefer, you can download updated packages via FTP and install them using the rpm command. Red Hat makes updated packages available on the public FTP servers ftp.redhat.com and updates.redhat.com .

To install an updated package, use the -F flag, which stands for freshen . For instance, to install a updated version of the gv package, issue the command:

rpm -Fvh gv-3.5.8-19.i386.rpm

By specifying -F rather than -U , you instruct RPM to install the updated package only if an earlier version of the package is already present. This lets you use wildcards to specify entire sets of updated packages:

rpm -Fvh *.rpm

This command will not install packages that aren't already installed. But, it will install updated versions of any existing packages.

8.9 Advanced RPM Techniques

Because you invoke the rpm command by using the shell, just as you do any other program, you can combine options and arguments to perform a variety of useful tasks . Consider the following examples:

rpm -Va

Verifies every installed package. You might find this command useful if you accidentally deleted some files. The output of the command would help you determine what packages, if any, suffered damage.

rpm -qf /usr/bin/mystery

Displays the name of the package that owns the specified file.

rpm -Vf /usr/bin/mystery

Verifies the package that owns the file /usr/bin/mystery .

rpm -qdf /usr/bin/puzzle

Lists the documentation files associated with the package that owns the file /usr/bin/puzzle . This could be helpful, for example, if /usr/bin/puzzle is a program you're having difficulty using.