The RPM database stores information about all RPM packages installed in your system. It is stored in the directory
/var/lib/rpm/, and is used to query what packages are installed, what versions each package is, and any changes to any files in the package since installation, among others.
To query this database, use the
rpm -q package namecommand displays the package name, version, and release number of the installed package
package name. For example, using
rpm -q footo query installed package
foomight generate the following output:
You can also use the following Package Selection Options with
-qto further refine or qualify your query:
-a— queries all currently installed packages.
-f— queries the RPM database for which package owns
f<filename>. When specifying a file, specify the absolute path of the file (for example,
-p— queries the uninstalled package
There are a number of ways to specify what information to display about queried packages. The following options are used to select the type of information for which you are searching. These are called Package Query Options.
-idisplays package information including name, description, release, size, build date, install date, vendor, and other miscellaneous information.
-ldisplays the list of files that the package contains.
-sdisplays the state of all the files in the package.
-ddisplays a list of files marked as documentation (man pages, info pages, READMEs, etc.).
-cdisplays a list of files marked as configuration files. These are the files you edit after installation to adapt and customize the package to your system (for example,
For options that display lists of files, add
-vto the command to display the lists in a familiar