-->

Previous | Table of Contents | Next

Page 60

that provide low-level structure for a Linux distribution. Let's see what installed packages make up the Base group:


# rpm -qg Base

setup-1.5-1

pamconfig-0.50-5

filesystem-1.2-1

crontabs-1.3-1

dev-2.3-1

etcskel-1.1-1

initscripts-2.73-1

mailcap-1.0-3

pam-0.50-17

passwd-0.50-2

redhat-release-4.0-1

rootfiles-1.3-1

termcap-9.12.6-5

#

One thing to keep in mind is that group specifications are case sensitive. Issuing the command rpm -qg base won't produce any output.

5.2.1.6. --whatprovides <x>: Query the Packages That Provide Capability <x>

RPM provides extensive support for dependencies between packages. Basically, a package might require what another package provides. The thing that is required and provided can be a shared library's soname (which is used to determine compatibility between different versions of the library). It can also be a character string chosen by the package builder. In any case, it's important to be able to display which packages provide a given capability.

This is just what the --whatprovides option does. When the option, followed by a capability, is added to a query command, RPM will select the packages that provide the capability. Here's an example:


# rpm -q --whatprovides module-info

kernel-2.0.18-5

#

In this case, the only package that provides the module-info capability is kernel-2.0.18-5.

5.2.1.7. --whatrequires <x>: Query the Packages That Require Capability <x>

The --whatrequires option is the logical complement to the --whatprovides option described earlier. It is used to display which packages require the specified capability. Expanding on the example we started with --whatprovides, let's see which packages require the module-info capability:


# rpm -q --whatrequires module-info

kernelcfg-0.3-2

#

There's only one package that requires module-info: kernelcfg-0.3-2.

Page 61

5.2.2. Querying Commands, Part II: Information Selection

After specifying the package (or packages) you wish to query, you'll need to figure out just what information you'd like RPM to retrieve. As you've seen, by default RPM only returns the complete package label. But there's much more to a package than that. Here, we'll explore every information selection option available.

5.2.2.1. -i: Display Package Information

Adding -i to rpm -q tells RPM to give you some information on the package or packages you've selected. For the sake of clarity, let's take a look at what it gives you and explain what you're looking at:


# rpm -qi rpm

Name        : rpm                       Distribution: Red Hat Linux Vanderbilt

Version     : 2.3                             Vendor: Red Hat Software

Release     : 1                           Build Date: Tue Dec 24 09:07:59 1996

Install date: Thu Dec 26 23:01:51 1996    Build Host: porky.redhat.com

Group       : Utilities/System            Source RPM: rpm-2.3-1.src.rpm

Size        : 631157

Summary     : Red Hat Package Manager

Description :

RPM is a powerful package manager, which can be used to build, install, query,

verify, update, and uninstall individual software packages. A package

consists of an archive of files, and package information, including name,

version, and description.

#

There's quite a bit of information here, so let's go through it entry by entry:

As you've probably noticed, these three pieces of information comprise the package label we've come to know and love. Continuing, we have these:

Page 62

5.2.2.2. -l: Display the Package's File List

Adding -l to rpm -q tells RPM to display the list of files that are installed by the specified package or packages. If you've used ls before, you won't be surprised by RPM's file list.

Here's a look at one of the smaller packages on Red Hat Linux—adduser:


# rpm -ql adduser

/usr/sbin/adduser

#

The adduser package consists of only one file, so there's only one filename displayed.

5.2.2.3. -v: Display Additional Information

In some cases, the -v option can be added to a query command for additional information. The -l option we've been discussing is an example of just such a case. Note how the -v option adds verbosity:

Previous | Table of Contents | Next