Uninstalling a package is just as simple as installing one. Type the following command at a shell prompt:
rpm -e foo
Note
Notice that we used the package name foo
, not the name of the original package file, foo-1.0-1.fc13.x86_64
. If you attempt to uninstall a package using the rpm -e
command and the original full file name, you will receive a package name error.
You can encounter dependency errors when uninstalling a package if another installed package depends on the one you are trying to remove. For example:
rpm -e ghostscript
error: Failed dependencies:
libgs.so.8()(64bit) is needed by (installed) libspectre-0.2.2-3.fc13.x86_64
libgs.so.8()(64bit) is needed by (installed) foomatic-4.0.3-1.fc13.x86_64
libijs-0.35.so()(64bit) is needed by (installed) gutenprint-5.2.4-5.fc13.x86_64
ghostscript is needed by (installed) printer-filters-1.1-4.fc13.noarch
Similar to how we searched for a shared object library (i.e. a
<library_name>
.so.<number>
file) in
Section 3.2.2.3, “Unresolved Dependency”, we can search for a 64-bit shared object library using this exact syntax (and making sure to quote the file name):
~]# rpm -q --whatprovides "libgs.so.8()(64bit)"
ghostscript-8.70-1.fc13.x86_64
Warning: Forcing Package Installation
Although we can force rpm
to remove a package that gives us a Failed dependencies
error (using the --nodeps
option), this is not recommended, and may cause harm to other installed applications. 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.