Updated: 3 November 2026 · Applies to: AlmaLinux, Rocky Linux and RHEL (rpm, dnf repoquery) and Debian/Ubuntu (dpkg)

To list the files a package installed, use rpm -ql <package> on an RPM based system or dpkg -L <package> on a Debian based system. Package names are case sensitive on both.

RPM based systems: AlmaLinux, Rocky Linux and RHEL

For a package that is already installed, rpm -ql lists every file it put on disk:

rpm -ql httpd

To check a .rpm file's contents before installing it, use -qlp instead:

rpm -qlp httpd-2.4.57-1.el9.x86_64.rpm

Listing files from the package repository, not just what is installed

repoquery can list a package's files straight from the repository metadata, which is useful when the package itself is not installed yet. It comes from the dnf-utils package (also installs yum-utils):

dnf install -y dnf-utils

Then query a package the same way:

repoquery -l httpd

repoquery also works as a dnf subcommand directly, with no separate package needed, on current AlmaLinux and Rocky releases:

dnf repoquery -l httpd

Debian based systems: Debian, Ubuntu and derivatives

For an installed package, dpkg -L lists its files:

dpkg -L apache2

To check a .deb file's contents before installing it, use dpkg-deb instead:

dpkg-deb -c apache2_2.4.58-1ubuntu8_amd64.deb

Finding which package owns a file, the other direction

If you have a file and want to know which package installed it, rather than the other way around, the same tools answer that too. On RPM based systems:

rpm -qf /usr/sbin/httpd

On Debian based systems:

dpkg -S /usr/sbin/apache2

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $131.99 a month.

Was this answer helpful?

Still stuck? Open a ticket