Uninstalling packages with rpm on CentOS/Fedora

Uninstalling packages with rpm on CentOS/Fedora

At times x86 and x64 versions of the same package may conflict with each other or with updates of packages that use them.

Yum is a great package manager but it doesn’t allow removing packages without also removing dependencies of that package. This is where the the old and mighty rpm comes in.

To search for a package by name, use rpm -ql package

To remove a package, use rpm -ev package –nodeps

For the more advanced operations, one can list / search for packages and list them with complete details:

rpm -qa –qf ‘%{name}-%{version}-%{release}.%{arch}\n’ | sort

rpm -qa –qf ‘%{name}-%{version}-%{release}.%{arch}\n’ | sort | grep package

Then you can remove *only* a particular version/platform edition of a package:

rpm -e packagename-version.platform

For example, rpm -e alchemist-1.0.36-1.i386 alchemist-1.0.36-1.x86_64

Leave a Reply