RPM is a very useful tool for both managing your system and diagnosing
and fixing problems. The best way to make sense of all the options is to
look at some examples.
Let's say you delete some files by accident, but you aren't sure
what you deleted. If you want to verify your entire system and see
what might be missing, you would enter:
rpm -Va
If some files are missing, or appear to have been corrupted, you
should probably either re-install the package or uninstall, then
re-install the package.
Let's say you run across a file that you don't recognize. To find
out which package owns it, you would enter:
rpm -qf /usr/X11R6/bin/xjewel
The output would look like:
xjewel-1.6-1
We can combine the above two examples in the following scenario.
Say you are having problems with
/usr/bin/paste. You would like to verify the
package that owns that program but you don't know which package that
is. Simply enter:
rpm -Vf /usr/bin/paste
and the appropriate package will be verified.
Want to find more about a particular program? You can find out by
entering the following to locate the documentation which came with
the package that "owns" that program (in this case
ispell):
Let's say you find a new koules RPM, but
you don't know what it is. To find out some information on it,
enter:
rpm -qip koules-1.2-2.i386.rpm
The output would be:
Name : koules Distribution: Red Hat Linux Colgate
Version : 1.2 Vendor: Red Hat Software
Release : 2 Build Date: Mon Sep 02 11:59:12 1996
Install date: (none) Build Host: porky.redhat.com
Group : Games Source RPM: koules-1.2-2.src.rpm
Size : 614939
Summary : SVGAlib action game; multiplayer, network
Description :
This arcade-style game is novel in conception and
excellent in execution. No shooting, no blood, no guts,
no gore. The play is simple, but you still must develop
skill to play. This version uses SVGAlib to run on a
graphics console.
Now you want to see what files the koules
RPM installs. You would enter: