RPM cheat sheet

by Stephen on November 6, 2009

RPM is the package manager for the following Linux Operating Systems: RedHat, CentOS, Fedora and SUSE. Here, I noted down some useful commands to manage RPM packages. Please share if you know other useful RPM commands.

 

 
Install a package:

rpm -ivh package_name

 
Upgrade a package:

rpm -Uvh package_name

 
Uninstall a package:

rpm -ev package_name

 
Uninstall a package without checking for its dependencies:

rpm -ev --nodeps package_name

 
Display the version of the installed package:

rpm -q package_name

 
Display the name and version of all packages installed in the server:

rpm -qa

 
Display the packages got installed recently:

rpm -qa --last

 
To rebuild a corrupted RMP database:

rpm --rebuilddb

 

Leave a Comment

Previous post:

Next post: