dnf-repoquery
Query repository package information
TLDR
Query a package for its dependencies
SYNOPSIS
dnf repoquery [options] package-specifier...
dnf repoquery --queryformat <fmt> [options] package-specifier...
dnf repoquery --whatdepends <capability>
dnf repoquery --whatprovides <capability>
PARAMETERS
--all
Query all available versions of packages matching the specifier, rather than just the newest or highest priority.
--depends
Display the direct dependencies of the specified packages.
--info
Show detailed information about the package, including summary, description, URL, and license.
--list
List the files included within the package, as if it were installed.
--provides
List the capabilities or virtual packages that the specified package provides.
--queryformat=<fmt>
Specify a custom output format using RPM-style tags for package metadata.
--requires
List the capabilities or virtual packages that the specified package requires.
--resolve
Recursively resolve and display all dependencies of the specified package, including nested dependencies.
--source
Display the name of the source RPM from which the binary package was built.
--whatdepends=<capability>
List packages that have a dependency on the given capability (e.g., a specific file or virtual package).
--whatprovides=<capability>
List packages that provide the given capability (e.g., a specific file or virtual package).
DESCRIPTION
dnf-repoquery is a powerful plugin for the DNF package manager, designed for querying detailed information about packages available in configured repositories. Unlike rpm -q which queries the RPM database of installed packages, dnf-repoquery fetches information directly from DNF's enabled repositories, allowing users to inspect packages that are not yet installed on the system.
It's an invaluable tool for system administrators and developers alike, facilitating tasks such as discovering package dependencies (both forward and reverse), identifying which repository provides a specific file or capability, comparing package versions across different repositories, or finding alternative packages. Its querying capabilities extend beyond simple package names, allowing for complex searches based on capabilities, filenames, or specific package attributes.
By leveraging dnf-repoquery, users can perform comprehensive analyses of the package ecosystem, anticipate dependency conflicts before installation, or troubleshoot issues related to missing or incorrect package versions, making it a critical component of advanced DNF usage. It streamlines the process of gaining insights into the vast amount of metadata managed by DNF.
CAVEATS
dnf-repoquery relies on the metadata from enabled repositories. If a repository is out of date or misconfigured, the query results might be inaccurate or incomplete.
It performs queries against repository metadata, not against the installed RPM database directly. For information about installed packages, rpm -q or dnf list installed are more appropriate.
Extensive use of options like --resolve can be resource-intensive and take time, especially on systems with many enabled repositories or complex dependency trees.
Results can vary slightly based on DNF's cache state; a dnf clean all followed by a fresh dnf update might be needed for the most up-to-date metadata.
COMMON USE CASES
Beyond basic package information, dnf-repoquery is frequently used for:
- Finding packages providing a specific file: dnf repoquery --whatprovides /usr/bin/python3
- Identifying reverse dependencies: dnf repoquery --whatdepends python3-libs
- Comparing versions across repositories: dnf repoquery --all <package-name>
EXIT STATUS
The command typically exits with 0 on success, 1 if an unhandled error occurs, and 100 if the command line usage is incorrect.
CONFIGURATION
dnf-repoquery honors the DNF configuration files (/etc/dnf/dnf.conf and files in /etc/dnf/plugins/). Repository configurations from /etc/yum.repos.d/ are also respected.
HISTORY
dnf-repoquery emerged as part of the DNF (Dandified YUM) project, which succeeded YUM (Yellowdog Updater, Modified) as the default package manager for Fedora, CentOS (since 8), and RHEL (since 8). The functionality provided by dnf-repoquery was previously available in yum-utils under the repoquery command. With the transition to DNF, this utility was re-implemented as a native DNF plugin, leveraging DNF's more efficient backend and modular architecture. Its development aimed to provide a faster, more reliable, and feature-rich querying tool that integrates seamlessly with DNF's powerful dependency resolution and repository management capabilities, addressing some of the performance and flexibility limitations observed in the older YUM repoquery utility.