include("site.inc"); $template = new Page; $template->initCommon(); $template->displayHeader(); ?>
You can do a lot more than just query packages in the RPM database. You can ask the rpm command to verify packages with the -V (or --verify) option.
The basic syntax is:
rpm -V verify_options package_name
For example:
# rpm -V telnet
#
If everything checks out, you'll get no response. The rpm command reports problems only. For example, if you have an installation of the telnet-server package that is missing some files, the rpm -V command will let you know, as shown following:
# rpm -V telnet-server
missing c /etc/xinetd.d/telnet
missing /usr/sbin/in.telnetd
missing d /usr/share/man/man5/issue.net.5.gz
In this example, the c and d stand for configuration and documentation files, respectively.
Note
The rpm -V command will also report missing dependencies.
To verify your entire system, use the -a option.
For example:
# rpm -Va
SM5....T c /usr/share/info/dir
.......T c /etc/krb5.conf
.......T /usr/share/pixmaps/gnome-default-dlg.png
.......T /usr/share/pixmaps/gnome-error.png
.......T /usr/share/pixmaps/gnome-info.png
.......T /usr/share/pixmaps/gnome-question.png
.......T /usr/share/pixmaps/gnome-warning.png
S.5....T c /etc/sysconfig/pcmcia
.....U.. /dev/winradio0
Each line that the rpm command outputs indicates a problem with the given file. The rpm command uses letter codes to show the type of the problem. Table 5-8 lists the letter codes with their meanings.
Table 5-8 RPM verify output codes
Code | Meaning |
S | File size differs. |
M | File mode differs. |
5 | The MD5 checksum differs. |
D | The major and minor version numbers differ on a device file. |
L | A mismatch occurs in a link. |
U | The file ownership differs. |
G | The file group owner differs. |
T | The file time (mtime) differs. |
You can use a number of options to tell the verification command specifically what to check for or not check for. Table 5-9 lists these options.
Table 5-9 Controlling the verification
Option | Usage |
--nodeps | Don't verify dependencies. |
--nodigest | Don't verify the package or header digests. |
--nofiles | Don't verify the file attributes. |
--noscripts | Don't try to verify the scripts. |
--nosignature | Don't verify the package or header signatures. |
--nolinkto | Don't verify the link file attribute. |
--nomd5 | Don't verify the MD5 digest file attribute. |
--nosize | Don't verify the file size attribute. |
--nouser | Don't verify the file owner attribute. |
--nogroup | Don't verify the file group owner attribute. |
--nomtime | Don't verify the file mtime attribute. |
--nomode | Don't verify the file mode attribute. |
--nordev | Don't verify the file rdev attribute. |
-a | Verify all packages in a given group. |
-g group | Verify all packages in a given group. |
-p file | Verify the given RPM file. |
Cross Reference
Chapter 12 covers another option for verifying a package file, the rpm –K command.
The --nofiles option is often used with the –Va option to verify the whole system but skip tests of file attributes. This command is used to often it has become an idiom for RPM usage, especially for debugging RPM problems. Run a command like the following:
$ rpm -Va --nofiles