Removing Installed Packages

After an RPM has been installed, you may need to remove it from the system for one reason or another. As it does when installing packages, RPM will check the dependencies of the package you want to remove. This check of dependencies is as important as checking package dependency during installation because you could end up deleting files that another RPM package depends on.

To remove packages, you need to erase (-e) the package from the system. As with installation of packages, RPM checks to see if any other RPM packages on the system depend on the package you want to remove. If a package does depend on it, the removal will fail. See Listing 12-6 for an example.


Removing a Dependent Package bible:/root # rpm -e blackbox error: Failed dependencies:

blackbox is needed by (installed) bbtools-2005.1.24-3

In this example, you have been told that the package bbtools depends on the Blackbox package we are trying to remove. To resolve this, you have two options, one good and one bad:

■ The bad option, which can prove marginally useful during both installation and removal of packages, is to tell RPM to ignore package dependencies. This should never really be used when removing a package because, as in the case of bbtools, other packages will stop working. However, during package installation, you may know for certain that a dependency that RPM is aware of is in fact resolved by a source-compiled library you have installed, or are testing. To tell RPM to not check for dependencies, use the --nodeps parameter, as well as the usual rpm -Uvh.

■ The good option (you do want to be a good administrator, don't you?) is to remove the dependent package, as well as the package you originally wanted to remove, as shown here:

bible:/root # rpm -e blackbox bbtools w^p ^s You may have noticed a very important characteristic of package removal, one com" ■ mon with most things in Unix — that is, when you are root, you are not warned that you are removing files. This holds true when removing packages. You were not asked to confirm the removal of bbtools and blackbox; rpm assumed you knew what you were doing.

Was this article helpful?

0 0

Post a comment