Querying the list of files contained in an RPM file
Posted October 19th, 2007 in Linux/Unix/BSD (Updated October 19th, 2007)
RPM is a package management tool created by RedHat for installing software packages, and can be used to query the files that will be installed by the RPM package file. You can query an RPM file that is on your local file system, or even a file that is on an FTP or HTTP server. The RPM file does not actually need to be installed on your system to be able to find out what it contains.
The syntax to query an RPM file from the command line is simple:
rpm -qpl filename.rpm
where filename.rpm is the name of the file you wish to query. The following examples would all work:
rpm -qpl zlib-1.2.3-3.i386.rpm
rpm -qpl ftp://mirrors.kernel.org/centos/5.0/os/i386/CentOS/zlib-1.2.3-3.i386.rpm
rpm -qpl http://mirrors.kernel.org/centos/5.0/os/i386/CentOS/zlib-1.2.3-3.i386.rpm
And the output from this would look similar to the following, although obviously the exact output would depend on which RPM you are querying:
warning: zlib-1.2.3-3.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
/usr/lib/libz.so.1
/usr/lib/libz.so.1.2.3
/usr/share/doc/zlib-1.2.3
/usr/share/doc/zlib-1.2.3/README
Subscribe!
If you found this post interesting and would like to be notified the next time something is posted, please subscribe to my RSS Feed. Thanks for visiting!
