Product SiteDocumentation Site

4.2. Getting Information on Packages

The query options for the rpm command include a whole set of options that return information about the files that make up a package, the scripts, and other parts of the original package. The following section cover these options.

4.2.1. Describing packages

The –i option with an rpm query command tells the rpm command to output descriptive information about the package. You can also use the longer option, --info, in place of –i. The basic syntax is:
rpm -qi package
The order of the command-line options is very important. Remember that the rpm command has the following general syntax:
rpm –MajorOperation –extra_options packages_or_files
The rpm –i command installs packages. The rpm –q command queries packages. The rpm –qi command outputs the descriptive information on packages. If you make a mistake and place the i in front of the q, you are telling the rpm command to perform a different operation.
When you run this command, being very careful with the order of the options, you’ll see output like the following, which describes the tcsh shell package.
# rpm -qi tcsh-6.10-6
Name : tcsh Relocations: (not relocateable)
Version : 6.10 Vendor: Red Hat, Inc.
Release : 6 Build Date: Sun 24 Jun 2001 10:45:29
Install date: Fri 14 Dec 2001 10:45:39 AM CST Build
Group : System Environment/Shells Source RPM: tcsh-6.10-6.src.rpm
Size : 764000 License: distributable
Packager : Red Hat, Inc. <>
Summary : An enhanced version of csh, the C shell.
Description :
Tcsh is an enhanced but completely compatible version of csh, the C
shell. Tcsh is a command language interpreter which can be used both
as an interactive login shell and as a shell script command processor.
Tcsh includes a command line editor, programmable word completion,
spelling correction, a history mechanism, job control and a C language
like syntax.
From this description, you can find out a lot about a package, such as where it comes from. Note how the description also names the source RPM used to build the package programs.
Cross Reference
The section on custom queries following in this chapter show how you can query for any information stored in a package header, including all of the information shown with the rpm –qi command, as well as any other header tag.