home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous SectionNext Section

8.4 Querying the RPM Database

You can query RPM's database, which lists the packages installed on your system. For example, to display a simple description of an installed package, use a command like this one:

rpm -q  package 

In this command, package is the name of the package you want RPM to describe. In response, RPM prints the package name, version, and release number.

Rather than use the -q option and the package name, you can use any of the following alternative options:

-a

Causes RPM to display information about all installed packages

-f file

Causes RPM to display information about the package that owns file

-p packagefile

Causes RPM to display information about the package contained in packagefile

You can also tailor the output of an RPM query, by specifying one or more of the following options:

-c

Causes RPM to display a list of configuration files included in the package

-d

Causes RPM to display a list of documentation files included in the package

-i

Causes RPM to display the package name, description, release number, size, build date, installation date, vendor, and other information

-l

Causes RPM to display the list of files that the package owns

-s

Causes RPM to display the state of all the files in the package—normal, not installed, or replaced

For example, the command:

rpm -qid rhide

displays information about the rhide package, including a list of documentation files included in the package.

    Previous SectionNext Section