Tuesday 1 October 2013

A Few Handy Queries of RPM

Below are some examples of situations you might find yourself in, and ways you can use RPM to get the information you need. Keep in mind that these are just examples. Don't be afraid to experiment!

Install a RPM

rpm -ivh package-name.rpm

Update a RPM

rpm -Uvh package-name.rpm

Remove a RPM

rpm -e package-name.rpm

List contents of installed RPM

rpm -qvl package-name

List contents of a RPM

rpm -qlp package-name

Print information about an installed RPM

rpm -qi package-name

Print information about a RPM

rpm -qpi package-name.rpm

List all installed RPM on your system

rpm -qa

Search for a installed RPM

rpm -qa | grep package-name

Print which package a file belongs to

rpm -qf /path/to/file

Extract files from a RPM into current directory

rpm2cpio package-name.rpm | cpio -idv

List out configuration file(s) for a RPM

rpm -qc package-name

List package dependencies

rpm -qpR package-name.rpm

Integrity check for a installed RPM

rpm -V package-name

Integrity check for a RPM

rpm -Vp package-name.rpm


Please post a comment if you would like to share your opinion on the above commands. Thank you.

No comments:

Post a Comment