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:
rpm -e PACKAGE_NAME
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:
rpm -ql PACKAGE_NAME
9. Verify an RPM package (output will show files that have changed):
rpm -V PACKAGE_NAME
10. Verify all RPM packages (output will show files that have changed):
rpm -qaV