list files installed from rpm or deb package

How to List Files Installed from RPM or Deb Package

Generally, software packages are installed as RPM files in RHEL/CentOS and DEB files in Ubuntu/Debian Linux systems. Sometimes you may need to know which files are installed as a part of a specific RPM or DEB package in Linux. In this article, we will learn how to list files installed from RPM or DEB package. It is important to keep track of all files installed in a certain package to make sure that the new files don’t break existing files and applications. It is also useful in case you are installing packages from unofficial repositories, to find out if there is any malicious content in them.


How to List Files Installed from RPM or Deb Package

Here are the steps to list files installed from RPM or DEB package. We will learn how to locate files in a certain package as well as group of packages. It will help you locate important files in a package, such as configuration files and documentation.


How to List Files in Installed RPM package

In RHEL/CentOS Linux systems, we will use repoquery command, which is a part of yum-utils, to find the files installed in RPM package. yum-utils is not installed by default on RHEL/CentOS systems. So open terminal and run the following command to install it.

# yum update 
# yum install yum-utils

Once you have installed yum-utils, you can list files of a given package using repoquery command with –installed option. Here is an example command to list all files in httpd (apache server) package. We have also used -l option to list the files.

# repoquery --installed -l httpd
# dnf repoquery --installed -l httpd  [On Fedora 22+ versions]

In Fedora 22+ systems, repoquery is already integrated as a part of dnf package manager.

You can also use rpm command for listing all files in RPM package. We have used -q and -l options to list files in package.

# rpm -ql httpd

You can also check the files that will be installed, using -p option. This is useful in case you want to find out what files will be installed on your system in case you install a specific package.

# rpm -qlp httpd


How to List Files Installed in Deb Package

On Debian/Ubuntu systems, you can use dpkg command with -L option to list files installed as a part of .deb package. Here is an example command to list all files installed as part of apache web server on your system.

$ dpkg -L apache2

In this article, we have learnt how to list all files installed as part of RPM or DEB packages. It is a good practice to go through the list of files installed as a part of any RPM or DEB package installed on your system. This way you will know where to find configuration files and documentation, and also be able to find out if any of the new libraries that are installed as a part of package break any of your existing libraries.

Also read:

How to Change Console Fonts in Ubuntu Server
How to Set Password for Single User Mode in Linux
How to Change Kernel Parameters At Runtime
How to Install Kernel Headers in RHEL/CentOS
How to Install Kernel Headers in Ubuntu & Debian

Leave a Reply

Your email address will not be published. Required fields are marked *