Next: 7.2.5 Verifying
Up: 7.2 Using RPM
Previous: 7.2.3 Upgrading
Querying the database of installed packages is accomplished with
rpm -q. A simple use is rpm -q foo
which will print the package name, version, and release number of the installed
package foo:
$ rpm -q foo
rpm-2.0-1
Instead of specifying the package name, you can use the following
options with -q to specify what package(s) you want to query. These are
called Package Specification Options.
- -a queries all currently installed packages.
- -f <file> will query the package
owning <file>.
- -F is the same as -f except it takes
filenames via stdin (e.g. find /usr/bin | rpm -qF).
- -p <packagefile> queries the
package <packagefile>.
- -P is like -p except it takes package filenames
from stdin (e.g. find /mnt/cdrom/RedHat/RPMS | rpm -qP).
There are a number of ways to specify what information to display
about queried packages.
The following options are used to select the information you
are interested in. These are called Information Selection
Options.
- -i displays package information such as name,
description, release, size, build date, install date, vendor,
and other miscellaneous information.
- -l displays the list of files that the package ``owns''.
- -s displays the state of all the files in the package. There
are only two possible states, normal and missing.
- -d displays a list of files marked as
documentation (man pages, info pages, README's, etc).
- -c displays a list of files marked as configuration
files. These are the files you change after installation to
adapt the package to your system (sendmail.cf, passwd, inittab, etc).
For those options that display file lists, you can add -v
to your command line to get the lists in a familiar ls -l
format.
Red Hat Software