-->

Previous | Table of Contents | Next

Page 86

the builders of the installed packages had on their systems. Also, some attributes change during normal system operation. It would be wise to check into each verification failure, just to make sure.

6.3.3. -f <file>: Verify the Package Owning <file> Against the RPM Database

Imagine this: You're hard at work when a program you've used a million times before suddenly stops working. What do you do? Well, before using RPM, you probably tried to find other files associated with that program and see if they had changed recently.

Now you can let RPM do at least part of that sleuthing for you. Simply direct RPM to verify the package owning the ailing program:


% rpm -Vf /sbin/cardmgr

S.5....T c /etc/sysconfig/pcmcia

%

Hmmmm. Looks like a config file was recently changed.

This isn't to say that using RPM to verify a package will always get you out of trouble, but it's such a quick step that it should be one of the first things you try. Here's an example of
rpm -Vf not working out as well:


% rpm -Vf /etc/blunder

file /etc/blunder is not owned by any package

%

Note that the issue surrounding RPM and symbolic links mentioned in Chapter 5, "Getting Information About Packages," also applies to rpm -Vf. Watch those symlinks!

6.3.4. -p <file>: Verify Against a Specific Package File

Unlike the previous options to rpm -V, each of which verifies one or more packages against RPM's database, the -p option performs the same verification, but against a package file. Why on earth would you want to do this when the RPM database is sitting there, just waiting to be used?

Well, what if you didn't have an RPM database? While it isn't a common occurrence, power failures, hardware problems, and inadvertent deletions (along with nonexistent backups) can leave your system sans database. Then your system hiccups; what do you do now?

This is where a CD full of package files can be worth its weight in gold. Simply mount the CD and verify to your heart's content:


# rpm -Vp /mnt/cdrom/RedHat/RPMS/i386/adduser-1.1-1.i386.rpm

#

Page 87

Whatever else might be wrong with this system, at least we can add new users. But what if you have many packages to verify? It would be a very slow process doing it one package at a time. That's where the next option comes in handy.

6.3.5. -g <group>: Verify Packages Belonging to <group>

When a package is built, the package builder must classify the package, grouping it with other packages that perform similar functions. RPM gives you the ability to verify installed packages based on their groups. For example, there is a group known as Shells. This group consists of packages that contain, strangely enough, shells. Let's verify the proper installation of every shell-related package on the system:


# rpm -Vg Shells

missing /etc/bashrc

#

One thing to keep in mind is that group specifications are case sensitive. Issuing the command rpm -Vg shells wouldn't verify many packages:


# rpm -Vg shells

group shells does not contain any packages

#

6.3.6. --nodeps: Do Not Check Dependencies Before Erasing Package

When the --nodeps option is added to a verify command, RPM will bypass its dependency verification processing. In this example, we've added the -vv option to the command line so we can watch RPM at work:


# rpm -Vvv rpm

D: opening database in //var/lib/rpm/

D: verifying record number 2341208

D: dependencies: looking for libz.so.1

D: dependencies: looking for libdb.so.2

D: dependencies: looking for libc.so.5

#

As you can see, the rpm package provides three different capabilities:

If we add the --nodeps option, the dependency verification of the three capabilities is no longer performed:


# rpm -Vvv --nodeps rpm

D: opening database in //var/lib/rpm/

D: verifying record number 2341208

#

Page 88

The line D: verifying record number 2341208 indicates that RPM's normal file-based verification proceeded normally.

6.3.7. --noscripts: Do Not Execute Verification Script

Adding the --noscripts option to a verify command prevents execution of the verification scripts of each package being verified. In the following example, the package verification script is executed:


# rpm -Vvv bother

D: opening database in //var/lib/rpm/

D: verifying record number 616728

D: verify script found - running from file /var/tmp/rpm-321.vscript

+ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin

+ export PATH

+ echo This is the bother 3.5 verification script

This is the bother 3.5 verification script

#

While the actual script is not very interesting, it did execute when the package was being verified. In the next example, we'll use the --noscripts option to prevent its execution:


# rpm -Vvv --noscripts bother

D: opening database in //var/lib/rpm/

D: verifying record number 616728

#

As expected, the output is identical to the prior example, minus the lines dealing with the verification script, of course.

6.3.8. --nofiles: Do Not Verify File Attributes

The --nofiles option disables RPM's file-related verification processing. When this option is used, only the verification script and dependency verification processing are performed. In this example, the package has a file-related verification problem:


# rpm -Vvv bash

D: opening database in //var/lib/rpm/

D: verifying record number 279448

D: dependencies: looking for libc.so.5

D: dependencies: looking for libtermcap.so.2

missing /etc/bashrc

#

When the --nofiles option is added, the missing file doesn't cause a message anymore:


# rpm -Vvv --nofiles bash

D: opening database in //var/lib/rpm/

D: verifying record number 279448

D: dependencies: looking for libc.so.5

D: dependencies: looking for libtermcap.so.2

#

Previous | Table of Contents | Next