Updated: 28 September 2026 · Applies to: dnf 4.14 to 4.20 on AlmaLinux and Rocky Linux 9 and 10 and RHEL 9 and 10; dnf5 on Fedora

repoquery answers questions about packages without installing anything: what a package needs, what needs it, which package provides a file, and what is available in which repository. On CentOS 7 and older releases it was a separate tool from yum-utils. Today it is built into dnf as dnf repoquery. If old scripts call plain repoquery, install the yum-utils package, which provides it as a shortcut on dnf 4 systems. We tested the examples on AlmaLinux 9.

What does a package need?

dnf repoquery --requires --resolve nano

--requires lists the capabilities the package needs (libraries, commands). --resolve turns them into the package names that provide them, for example glibc, ncurses-libs and file-libs for nano.

The full tree, including dependencies of dependencies:

dnf repoquery --requires --resolve --recursive nano

Each requirement with its provider, in detail:

dnf repoquery --deplist nano

What needs a package?

dnf repoquery --installed --whatrequires ncurses-libs

This lists installed packages that would break if you removed ncurses-libs. Without --installed, it searches all packages in the enabled repositories.

Which package provides a file?

dnf repoquery --whatprovides '*/bin/dig'
dnf provides '*/bin/dig'

Both work for files you do not have yet. For a file that is already installed, rpm -qf /usr/bin/dig is instant.

Versions and repositories

dnf repoquery --show-duplicates nginx               # every available version
dnf repoquery --qf '%{name} %{version} %{repoid}' nginx
dnf repoquery --list nano                           # files in a package
dnf repoquery --userinstalled                       # what you installed yourself

On Fedora (dnf5), add \n at the end of a --qf format, for example --qf '%{name} %{version}\n'.

Common problems

  • No results for a package you expect: its repository is disabled. Add --enablerepo=epel (or the repository you need), or check dnf repolist --all.
  • Old results: the metadata is cached; refresh it with dnf makecache --refresh.

To download packages together with their dependencies, see downloading RPM packages with dependencies.

Official documentation: DNF command reference (repoquery).

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