>From the redhat site....
In general, normal usage of the rpm command can
be summarised as follows:
Installation/Upgrading/Removal
To install a package: rpm -ivh
To upgrade a package: rpm -Uvh
To remove a package: rpm -e
To upgrade or install some packages you may need
additional flags to force
the install to happen. Only use these if you know
why these flags were
needed.
--force will overwrite files that are owned by
other packages.
--nodeps will install even if the package needs
packages that were not
installed.
Querying
To see if a package is installed: rpm -q
To get info on an installed package: rpm -qi
To list which files belong to a package: rpm -ql
To see what package a file belongs to: rpm -qf
One can usually join various query commands
together, so rpm -qil will
give info and list all the files in the package.
To look in a rpm filename that isn't installed,
you tag on the p to the
query line:
rpm -qilp somepackage.1.1-4.i386.rpm
this will list the information and the files
contained in somepackage.
More Advanced
More advanced usages can be found in the man page
for rpm and at the
web site:
ftp.rpm.org
Verification
To see what files on the system may have changed
from their initial
settings you can use RPM, to check up on them.
rpm -Va
will give you a list of all files that have
changed since the package it
is associated was installed. This can be a lot of
files (and a lot may be
changed due to post installation work). To just
see what packages have
changed so that you can verify them individually,
type:
rpm -Va | awk ''{print $2}'' | xargs rpm -qf |
sort -u &> /tmp/file1
Then look in the file /tmp/file1 for which
packages have changed.