include("site.inc"); $template = new Page; $template->initCommon(); $template->displayHeader(); ?>
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
/etc/xinetd.d/telnet
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
/etc/xinetd.d/telnet
/usr/sbin/in.telnetd
/usr/share/man/man5/issue.net.5.gz
/usr/share/man/man8/in.telnetd.8.gz
/usr/share/man/man8/telnetd.8.gz
Querying Package Files Remotely
As shown in Chapter 4, 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 4, 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 | 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 |