Product SiteDocumentation Site

A.2.4. Querying Packages

The RPM database stores information about all RPM packages installed on the system. It is stored in the /var/lib/rpm/ directory and is used for many things, including querying what packages are installed, what version each package is, and for calculating changes to files in packages since their installation. To query this database, use the rpm command with the -q (or --query) option:
rpm -q package_name
This command displays the package name, version, and release number of the installed package package_name. For example:
~]$ rpm -q tree
See the Package Selection Options subheading in the rpm(8) manual page for a list of options that can be used to further refine or qualify your query. Use options listed below the Package Query Options subheading to specify what information to display about the queried packages.