-->

Previous | Table of Contents | Next

Page 63


# rpm -qlv adduser

-rwxr-xr-x- root root 3894 Feb 25 13:45 /usr/sbin/adduser

#

Looks a lot like the output from ls, doesn't it? Looks can be deceiving. Everything you see here is straight from RPM's database. However, the format is identical to that of ls, so it's more easily understood. If this is Greek to you, consult the ls man page.

5.2.2.4. -c: Display the Package's List of Configuration Files

When -c is added to an rpm -q command, RPM will display the configuration files that are part of the specified package or packages. As mentioned earlier in the book, config files are important because they control the behavior of the packaged software. Let's take a look at the list of config files for XFree86:


# rpm -qc XFree86

/etc/X11/fs/config

/etc/X11/twm/system.twmrc

/etc/X11/xdm/GiveConsole

/etc/X11/xdm/TakeConsole

/etc/X11/xdm/Xaccess

/etc/X11/xdm/Xresources

/etc/X11/xdm/Xservers

/etc/X11/xdm/Xsession

/etc/X11/xdm/Xsetup 0

/etc/X11/xdm/chooser

/etc/X11/xdm/xdm-config

/etc/X11/xinit/xinitrc

/etc/X11/xsm/system.xsm

/usr/X11R6/lib/X11/XF86Config

#

These are the files you'd want to look at first if you were looking to customize XFree86 for your particular needs. Just like -l, we can also add v for more information:


# rpm -qcv XFree86

-r--r--r--- root root 423 Mar 21 00:17 /etc/X11/fs/config

...

lrwxrwxrwx- root root 30 Mar 21 00:29 /usr/X11R6/lib/X11/XF86Config

-> ../../../../etc/X11/XF86Config

#

Note that last file: RPM will display symbolic links, as well.

5.2.2.5. -d: Display a List of the Package's Documentation

When -d is added to a query, we get a list of all files containing documentation for the named package or packages. This is a great way to get up to speed when you're having problems with unfamiliar software. As with -c and -l, you'll see either a simple list of filenames or (if you've added -v) a more comprehensive list. Here's an example that might look daunting at first, but really isn't:


# rpm -qdcf /sbin/dump

/etc/dumpdates

Page 64


/usr/doc/dump-0.3-5

/usr/doc/dump-0.3-5/CHANGES

/usr/doc/dump-0.3-5/COPYRIGHT

/usr/doc/dump-0.3-5/INSTALL

/usr/doc/dump-0.3-5/KNOWNBUGS

/usr/doc/dump-0.3-5/THANKS

/usr/doc/dump-0.3-5/dump-0.3.announce

/usr/doc/dump-0.3-5/dump.lsm

/usr/doc/dump-0.3-5/linux-1.2.x.patch

/usr/man/man8/dump.8

/usr/man/man8/rdump.8

/usr/man/man8/restore.8

/usr/man/man8/rmt.8

/usr/man/man8/rrestore.8

#

Let's take that alphabet soup set of options one letter at a time:

The list of files represents all the documentation and config files that apply to the package owning /sbin/dump.

5.2.2.6. -s: Display the State of Each File in the Package

Unlike the past three sections, which deal with lists of files of one type or another, adding -s to a query will list the state of the files that comprise one or more packages. I can hear you out there; you're saying, "What is the state of a file?" For every file that RPM installs, there is an associated state. There are four possible states:

Page 65

Here's an example showing how file states appear:


# rpm -qs adduser

normal /usr/sbin/adduser

#

The normal at the start of the line is the state, followed by the filename.

The file state is one of the tools RPM uses to determine the most appropriate action to take when packages are installed or erased.

Would the average person need to check the states of files? Not really. But if there should be problems, this kind of information can help get things back on track.

5.2.2.7. --provides: Display Capabilities Provided by the Package

By adding --provides to a query command, you can see the capabilities provided by one or more packages. If the package doesn't provide any capabilities, the --provides option produces no output:


# rpm -q --provides rpm

#

However, if a package does provide capabilities, they will be displayed:


# rpm -q --provides foonly

index

#

It's important to remember that capabilities are not filenames. In the preceding example, the foonly package contains no file called index; it's just a character string the package builder chose. This is no different from the following example:


# rpm -q --provides libc

libm.so.5

libc.so.5

#

While there might be symlinks by those names in /lib, capabilities are a property of the package, not a file contained in the package!

5.2.2.8. --requires: Display Capabilities Required by the Package

The --requires option (-R is equivalent) is the logical complement to the --provides option. It displays the capabilities required by the specified package(s). If a package has no requirements, there's no output (or, in later versions of RPM, the word none):


# rpm -q --requires adduser

#

Previous | Table of Contents | Next