Product SiteDocumentation Site

4.4. 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 query_options filename
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 qt-4.6.2-17.fc12.x86_64.rpm 
/etc/Trolltech.conf
To list all the files in an RPM package, combine the -q, -p, and -l options (example output truncated):
$ rpm -qpl qt-4.6.2-17.fc12.x86_64.rpm
/etc/Trolltech.conf
/usr/bin/qdbus
/usr/lib64/libQtCore.so.4
/usr/lib64/libQtCore.so.4.6
/usr/lib64/libQtCore.so.4.6.2
/usr/lib64/libQtDBus.so.4
/usr/lib64/libQtDBus.so.4.6
/usr/lib64/libQtDBus.so.4.6.2
/usr/lib64/libQtNetwork.so.4
/usr/lib64/libQtNetwork.so.4.6

4.4.1. 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 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
Meaning
--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