DNF5-DEPTREE(8) dnf5 DNF5-DEPTREE(8)

dnf5-deptree - Deptree Command

dnf5 [GLOBAL OPTIONS] deptree [OPTIONS] <package-spec>...

deptree displays a package dependency graph using enabled repository metadata by default. With --installed, it uses packages from the local RPMDB instead. It does not invoke the dependency solver.

By default, dependencies of type Requires are followed. Requirements with a single provider link directly to that provider. Requirements with multiple providers are displayed below a choice: node. rpmlib(*) requirements are ignored. Requirements with no provider are displayed as unsatisfied: nodes.

Each package subtree is expanded once across all selected roots, at an occurrence whose dependency depth is minimal from any root. Other occurrences with a subtree are marked with [expanded elsewhere], even if the expansion appears later in the output or under another root. Leaf nodes are not marked. This prevents cycles and repeated subtree expansion.

Dependencies retain their metadata order within each requested type. Provider candidates and reverse dependents are sorted by NEVRA. Rich-expression operands retain their expression order.

Package specifications accept package names, NEVRAs, and glob patterns. For an ambiguous specification without an architecture, the command selects the latest EVR for each matching architecture. Dependency providers and reverse dependents follow the same policy. --arch limits roots and traversal to the specified architectures. Use --showduplicates to retain all matching versions. An architecture-qualified NEVRA is honored as written.

In repository mode, repository selection follows the standard global options, including --repo, --enable-repo, and --disable-repo.

Show packages that depend on each selected package. Reverse traversal uses
the latest EVR of each package name and architecture by default.
Print a sorted, deduplicated list of package NEVRAs instead of a tree.
Display dependency trees for installed packages only.
Show only branches leading to packages with specified names. This is a
list option; package-name globs are supported. A matching package is
retained as a leaf, along with all shortest paths from a selected root to
it. Each matching package is considered separately. Dependency levels are
counted as for --depth.
Limit roots, provider candidates, and reverse dependents to the specified
architectures. This option can be specified multiple times.
Include packages reachable within N dependency levels from any selected
root. 0 prints only roots. Only package nodes count toward dependency
depth; choice, condition, else, requirement, and unsatisfied nodes add no
depth. Shared package subtrees are expanded only at their minimum depth,
keeping displayed branches within N package levels.
Render explicit requirement: nodes between packages and their providers.
This option applies only to forward traversal and conflicts with --reverse.
Process the comma-separated dependency types in LIST. Accepted values
are requires, recommends, suggests, supplements, and
enhances. The default is requires.
Include every matching package EVR. Without this option, ambiguous roots
and traversal candidates use the latest EVR per name/architecture.
Print machine-readable JSON. Normal mode emits a graph with roots,
nodes, and edges arrays. Combined with --flat, it emits a
sorted JSON array of NEVRA strings.

dnf5 deptree --json <package-spec>

Without --flat, the command returns a graph object with these fields:

  • roots (array of strings): IDs of root package nodes.
  • nodes (array of objects): each graph node appears once. Every node has an id and type.
  • package nodes contain name, epoch, version, release, and arch (all strings). Their IDs begin with pkg:.
  • choice nodes contain capability (string). Their IDs begin with choice:.
  • conditional nodes contain condition (string). Their IDs begin with cond:.
  • else nodes contain condition (string). Their IDs begin with else:.
  • requirement nodes, produced by --show-requires, contain capability (string). Their IDs begin with requirement:.
  • unsatisfied nodes contain the unresolved capability (string). Their IDs begin with unsatisfied:.
•
edges (array of objects): graph links with source and target node IDs. Every edge contains requirements, an array of capability strings. It is empty for graph-structure links and provider links.

dnf5 deptree --flat --json <package-spec>

With both --flat and --json, the command returns a sorted JSON array of unique package NEVRA strings. All non-package nodes, including unsatisfied requirements, are omitted.

Show dependencies of the newest matching libsolv package builds.
Show packages in enabled repositories that depend on matching dnf5
package builds.
Show every matching libsolv build and one dependency level.
Emit a JSON dependency graph that includes both hard and recommended
dependencies.
Show only shortest dependency paths from packageA that reach matching packages.

See AUTHORS.md in dnf5 source distribution.

Contributors to the dnf5 project.

November 15, 2026