An RPM file is a Red Hat Package Manager file. RPM is a package manager developed by Red Hat primarily for RedHat-based Linux operating systems such as RHEL, CentOS, Fedora, etc. Developed based on Linux Standard Base (LSB), the open-source RPM is used to manage, install, uninstall software packages in Linux systems. Every RPM package that contains a collection or bundle of files uses the .rpm extension.
|Documentation files||AUTHOR, TODO, README, etc.|
|Configuration files||Logrotate.conf, updatedb.conf, sshd.conf, etc.|
|Binary files(executables)||Sshd, ssh, xattr, stat, nmap, and so on.|
Now, we will cover different options for listing files on a Linux system under a certain package or group.
You can easily locate all the files installed from the RPM package by checking the RPM package manifest in your system. You can also see all the files and locations for a particular RPM package through this method.
The following is the output of the RPM command in the above example:
- -q is for specifying that the command is used for the query
- -l for listing the files in the package
- -p for giving the query the uninstalled package file.
Listing in RHEL/CentOS Linux-based Systems
You can list the files that are part of yum-utils installed on the RHEL/CentOS system from any downloaded or given package using the repoquery command. You can install and use yum-utils using the following command.
yum install yum-utils
Once you have installed yum-utils, you can easily list the RPM package files by running the following command (We have used Firefox for the example):
Listing in Fedora Based Linux Systems
In Using dnf, the repoquery command can show files installed from packages in Fedora 22+.
Alternatively, you can list the files installed in the system or inside the .rpm package using the following RPM command. Here, -I or -g means to list the files in the package implicitly:
Listing in Ubuntu/Debian Based-Linux Systems
You can use the dpkg command on an Ubuntu/Debian distribution with the -L flag to list its derivatives or files installed in Debian systems from any .deb package.
Listing RPM Files Before Installing the Package
With the -p option, we can list .rpm package files before installation. Suppose you download any telnet-server RPM package from any online source. Then you can see through the following commands what is present in the downloaded package, which will be installed in the file system or can be done.
This article taught us how to find or list all the files installed from a package or group of RPM packages in Linux. Different distributions of Linux list these packages using different methods and commands. If you want to know any information related to this article, please tell us by commenting in the comment box.