LinuxCommandLibrary

dnf-repoquery

Query repository package information

TLDR

Query a package for its dependencies

$ dnf [[rq|repoquery]] --deplist [package]
copy

SYNOPSIS

dnf repoquery [options] [package-spec]

PARAMETERS

--all
    Show all versions/matches instead of just the best.

--alldeps
    Include dependencies in query results.

--archlist
    Limit query to specified architectures.

--available
    Limit to available (not installed) packages.

--disablerepo
    Disable specific repositories.

--enablerepo
    Enable additional repositories.

--file
    Treat arguments as filenames to query.

--info
    Show package summary information.

--installed
    Limit to installed packages.

--location
    Show download URL for packages.

--obsoletes
    List packages this one obsoletes.

--provides
    List capabilities/files this package provides.

--qf, --queryformat
    Custom output format string.

--querytags
    List available query format tags.

--requires
    List dependencies this package requires.

--resolution
    Resolve capabilities to package names.

--rpm
    Show binary RPM filenames (default).

--source
    Query source RPMs instead of binary.

--srpm
    Show source RPM filenames.

--suggests
    List suggested packages.

--upgrades
    Show upgrade paths for packages.

--userinstalled
    Limit to user-installed packages.

--whatprovides
    List packages providing a capability/file.

--whatrequires
    List packages requiring a capability.

DESCRIPTION

dnf repoquery is a versatile command-line tool from the DNF package manager, used to query detailed information about packages in repositories without downloading or installing them. It excels at revealing package dependencies, provided files/capabilities, obsoletes, upgrades, and changelog details, making it invaluable for dependency analysis, scripting, and troubleshooting package conflicts.

Unlike basic dnf list or dnf info, repoquery supports advanced filtering by architecture, repository, and package state (available, installed, source RPMs). Users can customize output with --queryformat (or -q) for structured data like CSV or JSON-like formats, ideal for automation. It operates on cached metadata by default but fetches updates from remote repos if needed.

Common use cases include checking what provides a file (--whatprovides), listing requirements (--requires), or exploring upgrade paths (--upgrades). It supports glob patterns and exact specs for precise queries, enhancing efficiency in large repos like those in Fedora, RHEL, or CentOS.

CAVEATS

Requires repository metadata (downloads if not cached, needs network). Default behavior shows best match only unless --all used. Many options inherited from dnf; check dnf repoquery --help for full list.

EXAMPLES

dnf repoquery --requires httpd
Lists dependencies for httpd package.

dnf repoquery --whatprovides '/usr/bin/vim' --installed
Finds installed packages providing vim binary.

dnf repoquery --qf '%{name}-%{version}-%{release}.%{arch} %{repoid}' '*kernel*'
Custom format for kernel packages across repos.

HISTORY

Introduced with DNF 1.0 in Fedora 22 (2015) as successor to YUM's repoquery from yum-utils. Enhanced for better performance, parallel downloads, and modular design in later DNF versions (now DNF5).

SEE ALSO

dnf(8), repoquery(1), yum-utils(1)

Copied to clipboard