Quick Start Guide

Example 9.3: Script to Search for Packages
#! /bin/sh
for i in $(rpm -q -a -l | grep $1); do
echo "\"$i\" is in package:"
rpm -q -f $i
echo ""
done
The command rpm -q --changelog rpm displays a detailed list of change information
about a specic package (in this case, the rpmpackage), sorted by date.
With the help of the installed RPM database, verication checks can be made. Initiate
these with -V, or --verify. With this option, rpm shows all les in a package that have
been changed since installation. rpm uses eight character symbols to give some hints
about the following changes:
Table 9.2: RPM Verify Options
MD5 check sum
5
File size
S
Symbolic link
L
Modication time
T
Major and minor device numbers
D
Owner
U
Group
G
Mode (permissions and le type)
M
In the case of conguration les, the letter c is printed. For example, for changes to
/etc/wgetrc (wget package):
rpm -V wget
S.5....T c /etc/wgetrc
The les of the RPM database are placed in /var/lib/rpm. If the partition /usr has a
size of 1 GB, this database can occupy nearly 30 MB, especially after a complete
update. If the database is much larger than expected, it is useful to rebuild the
database with the option --rebuilddb. Before doing this, make a backup of the old
database. The cron script cron.daily makes daily copies of the database (packed
with gzip) and stores them in /var/adm/backup/rpmdb. The number of copies is con-
126 Start-Up