Ten Useful RPM (RPM Package Manager) Usage Examples

RPM is the underlying package management system used on CentOS Linux. In this post, we’ll go through a couple of common RPM usage examples:

1. List all packages:

rpm -qa

2. List a specific package:

rpm -qa | grep PACKAGE_NAME

3. Install an RPM package:

rpm -ivh PACKAGE_NAME.rpm

4. Install OR upgrade an existing RPM package:

rpm -Uvh PACKAGE_NAME.rpm

5. Remove an RPM package:


6. Remove an RPM package without removing dependencies:

rpm -e --nodeps PACKAGE_NAME

7. List the package that a particular file or directory belongs to:

rpm -qf /path/to/file

8. List all the files of a particular RPM package:


9. Verify an RPM package (output will show files that have changed):


10. Verify all RPM packages (output will show files that have changed):

rpm -qaV
Share This Post

About Author: Curtis K

Hi! My name is Curtis, and I am the author of CentOS Blog. Please feel free to comment with any suggestions, feedback or questions!