ESDS Knowledge Base


Frequently Used RPM Commands On Linux


RPM Package Manager: Originally Redhat Package Manager, abbreviated RPM is a useful package manager using which you can install, query, verify, update and remove/erase software packages installed on your dedicated server. RPM packages come in two varieties: Binary packages and Source packages.

Binary package is used to encapsulate software to be installed where as Source packages contains the source code and other necessary data required to produce binary packages.

RPM was intended primarily for Linux distributions such as Redhat, Suse, CentOS, Fedora and many other Linux distributions.

Following are most common commands used with RPM :

rpm -ivh {rpm-file}
:-  Install the package.

rpm -Uvh {rpm-file}
:-  Upgrade package.

rpm -ev {package}
:-  Erase/remove/ an installed package.

rpm -ev –nodeps {package}
:-   Erase/remove/ an installed package without checking for dependencies.

rpm –qa
: –  Display list all installed packages.

rpm -qi {package}
:-  Display installed information along with package version and short description.

rpm -qf {/path/to/file}
:- Find out what package a file belongs to i.e. find what package owns the file.

rpm -qc {pacakge-name}
:-  Display list of configuration file(s) for a package.

rpm -qcf {/path/to/file}
:-  Display list of configuration files for a command.

rpm -qa –last
:-  Display list of all recently installed RPMs.

rpm -qR {package}
:-  Find out what dependencies a rpm file have.

Leave a Reply