Installation guide
222 Chapter 25. Package Management with RPM
#
Note
Notice that we used the package name foo. To query a package, you will need to replace foo with
the actual package name.
Instead of specifying the package name, you can use the following options with -q to specify
the package(s) you want to query. These are called Package Specification Options.
• -a queries all currently installed packages.
• -f
file will query the package which owns file . When specifying a file, you must
specify the full path of the file (for example, /usr/bin/ls).
• -p
packagefile queries the package packagefile .
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 Selection Options.
• -i displays package information including name, description, release, size, build date,
install date, vendor, and other miscellaneous information.
• -l displays the list of files that the package contains.
• -s displays the state of all the files in the package.
• -d displays a list of files marked as documentation (man pages, info pages, READMEs,
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 (for example, sendmail.cf, passwd,
inittab, etc.).
For the options that display lists of files, you can add -v to the command to display the lists
in a familiar ls -l format.
25.2.7. Verifying
Verifying a package compares information about files installed from a package with the same
information from the original package. Among other things, verifying compares the size,
MD5 sum, permissions, type, owner, and group of each file.
The command rpm -V verifies a package. You can use any of the Package Selection Options
listed for querying to specify the packages you wish to verify. A simple use of verifying is
rpm -V foo, which verifies that all the files in the foo package are as they were when they
were originally installed. For example:
• To verify a package containing a particular file:
rpm -Vf /bin/vi
• To verify ALL installed packages:
rpm -Va