Product SiteDocumentation Site

4.3. Getting Information on Package Files

In addition to querying the RPM database about installed packages, the rpm command provides the handy ability to extract information from RPM files. This is very useful for determining whether you want to install a given package or not. It also helps with the simple task of figuring out what a package’s purpose, especially if names like kudzu, anaconda, or dia don’t immediately tell you what the corresponding packages provide.
The –p option tells the rpm command to provide information on the given package file. The basic syntax is:
rpm –qp option_query_options filename.rpm
You can use the longer option, --package, in place of –p. You can also pass more than one RPM file to the command.
The query information options shown previously for installed packages also work for RPM files. For example, to list the configuration files for a package, combine the -q, -p, and -c options with the name of a package file, as shown following:
# rpm -qpc telnet-server-0.17-23.i386.rpm
To list all the files in an RPM package, combine the -q, -p, and -l options:
# rpm -qpl telnet-server-0.17-23.i386.rpm
Querying Package Files Remotely
As shown in Chapter 3, Using RPM , you can access RPM package files over a network using FTP or HTTP connections. To query remote files, use the same rules as shown in Chapter 3, Using RPM , with the following syntax:
rpm -qp ftp://username:password@hostname:port/path/to/rpm/file
rpm -qp ftp://username@hostname:port/path/to/rpm/file
rpm -qp ftp://hostname:port/path/to/rpm/file
rpm -qp http://hostname:port/path/to/rpm/file
If your system resides behind a firewall with a proxy server, use the options in the following table to name the proxy. Note that these proxy options only work with the TIS Firewall toolkit.
Network Proxy Option
--ftpproxy proxy_hostname
Names the proxy system
--ftpport proxy_port_number
Network port number on the proxy system
--httpproxy proxy_hostname
Names the proxy system
--httpport proxy_port_number
Network port number on the proxy system