RPM Cheat Sheet

0

RPM stands for Red Hat Package Manager. There are a variety of distributions besides Red Hat that use RPM to manage packages including Fedora, Mandriva, SUSE, CentOS, and Yellow Dog Linux among others. RPM uses a database to keep track of what packages have been installed on the system and where they are located. This functionality allows you to easily query, install, upgrade, and remove packages from your system.

RPM packages are distributed in the following format “<package>.<version>.<architecture>.rpm

Check the package information.
$ rpm -qi mypackage.1.2.3.x86_64.rpm

List the files that will be installed.
$ rpm -ql mypackage.1.2.3.x86_64.rpm

Install an RPM package with the ‘-i‘ option.
$ rpm -i mypackage.1.2.3.x86_64.rpm

Upgrade a package that is already installed.
$ rpm -U mypackage.2.0.0.x86_64.rpm

Remove a package. You only need to provide the package name and not the version or rpm suffix.
$ rpm -e mypackage

View all the installed packages on your system.
$ rpm -qa

If you want to see more output you can increase the verbosity by adding the ‘-v‘ option to any of these commands. To raise it even further you can add ‘-vv‘.

Share.