Suppose you want to install a particular RPM package on Fedora or CentOS, but want to check the content of the package before installing it. This situation may arise when you try to install any missing binary or library file in your system.
In this tutorial, I will describe how to list all files contained in a RPM package on CentOS, Fedora or RHEL.
There is a command-line tool called repoquery which can query information of YUM repositories. This tool allows you to view the content of a RPM package without installing the package.
To install repoquery on CentOS, Fedora or RHEL:
To check a list of files contained in a particular package (e.g., tcpdump) using repoquery:
/usr/sbin/tcpdump /usr/sbin/tcpslice /usr/share/doc/tcpdump-4.3.0 /usr/share/doc/tcpdump-4.3.0/CHANGES /usr/share/doc/tcpdump-4.3.0/CREDITS /usr/share/doc/tcpdump-4.3.0/LICENSE /usr/share/doc/tcpdump-4.3.0/README /usr/share/man/man8/tcpdump.8.gz /usr/share/man/man8/tcpslice.8.gz
The second method to view all the files inside a package without installing it is via rpm command. In this case, however, you need to download a RPM package locally in order to query the package with rpm command.
You can download a RPM package with yum command. Since you do not want to install it, you must use "--downloadonly" option.
To download a particular RPM package without installing it, you need to install a Yum plugin for adding "--downloadonly" command option as follows.
Now you can use yum command to download a RPM package as follows.
With "reinstall" option, the above command will download a requested RPM package, even when the package is currently installed on your system. The downloaded package will be stored in /tmp directory as requested.
To list files of a downloaded RPM package, run the following command.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!