15.2.6. Querying

15.2.6. Querying

Use the rpm -q command to query the database of installed packages. The rpm -q foo command displays the package name, version, and release number of the installed package foo:

foo-2.0-1

Note

To query a package, replace foo with the actual package name.

Instead of specifying the package name, use the following options with -q to specify the package(s) you want to query. These are called Package Selection Options.

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 Information Query Options.

For the options that display lists of files, add -v to the command to display the lists in a familiar ls -l format.


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-4 because CentOS-4 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-4 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.