Fedora DNF5

ID

dnf5

Home page

https://github.com/rpm-software-management/dnf5

Version requirement

>= 5

Platforms

🅱️ BSD · 🐧 Linux · ⨂ Unix

Operations

installed · outdated · orphans · search · install · upgrade · upgrade_all · remove · sync · cleanup · doctor

purl types

pkg:dnf5 · pkg:rpm

CLI name

dnf5

Every call

dnf5 --quiet <command>

Issues and PRs

📦 manager: rpm-based

Source

meta_package_manager/managers/dnf.py

The dnf5 rewrite of DNF, Fedora’s reference package manager since Fedora 41.

Inherits every operation and parser from DNF. Its forced arguments drop --color=never (dnf5 rejects that option), keeping only --quiet.

What mpm adds to dnf5

Through mpm, dnf5 gains --exact and --extended search, to narrow to exact names or match descriptions.

Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover dnf5 alongside dnf, yum, zypper and any other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your dnf5 commands, in mpm

You already know dnf5: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With dnf5

With mpm

List what’s installed

dnf repoquery --userinstalled --qf FORMAT

mpm --dnf5 installed

List outdated packages

dnf repoquery --upgrades --qf FORMAT

mpm --dnf5 outdated

Search for a package

dnf --color=never search usd

mpm --dnf5 search usd

Install a package

sudo dnf --color=never --assumeyes install pip

mpm install pkg:dnf5/pip

Upgrade one package

sudo dnf --color=never --assumeyes upgrade pip

mpm --dnf5 upgrade pip

Upgrade everything

sudo dnf --color=never --assumeyes upgrade

mpm --dnf5 upgrade --all

Remove a package

sudo dnf --color=never --assumeyes remove pip

mpm remove pkg:dnf5/pip

List orphaned dependencies

dnf --color=never repoquery --unneeded

mpm --dnf5 orphans

Clear caches

sudo dnf --color=never clean all

mpm --dnf5 cleanup --cache

Run health checks

dnf --color=never check

mpm --dnf5 doctor

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Operations

Operation

Supported

Notes

installed

outdated

orphans

search

exact and extended search backfilled by mpm

install

upgrade

upgrade_all

remove

--orphans also drops the package’s orphaned dependencies

sync

cleanup

--orphans runs the system-wide orphan sweep

doctor

Selecting and configuring dnf5

Deselect dnf5 for a single run with --no-dnf5, or persist the choice in your configuration:

[mpm]
dnf5 = false

The arguments and environment variables listed in the box atop this page are forced on every dnf5 call, so runs stay quiet, non-interactive and reproducible: the defaults you would set in CI anyway.

Keep it enabled but tune how mpm drives it with a per-manager override:

[mpm.managers.dnf5]
timeout = 900

mpm config-template dnf5 prints every overridable attribute as a ready-to-paste block.

Recipes

A few jobs you would otherwise script around dnf5, one mpm command each:

  • Snapshot and clone a machine: mpm --dnf5 dump dnf5.toml, then mpm restore dnf5.toml on the next one.

  • Export a compliance SBOM: mpm --dnf5 sbom (CycloneDX by default, --spdx for SPDX).

  • Gate CI on health: mpm --dnf5 doctor relays Fedora DNF5’s own diagnosis and exits non-zero on trouble.

Privilege escalation

System-wide manager: mpm wraps its privileged operations in sudo out of the box. Instead of letting the tool prompt mid-run, mpm primes the credential cache up-front, with a single branded password prompt at most. Turn escalation off for rootless setups with --no-sudo or the per-manager sudo override.

See privilege escalation for the full policy.

Cooldown

State of Fedora DNF5’s release-age gating, from the cooldown support table:

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

  • Registry: Distro binary archives (pkg:deb, pkg:rpm, pkg:alpm, pkg:apk)

  • Retraction: Index revert: removal is an archive operation and the mirror is rebuilt without the package. Debian, for one, requires filing an RM: bug against ftp.debian.org (developers-reference)

  • Publish date: ❌ the version string is the distro maintainer’s build, carrying no upstream publication date

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Version probe

The version is extracted from the output of dnf5 --version with:

r"(?P<version>\S+)"

Changelog

  • 7.4.0 (2026-07-25)

    • Plain cleanup no longer removes orphaned packages: their native sweeps moved behind cleanup --orphans. This also stops emerge’s cleanup from triggering its pre-depclean world upgrade unless --orphans is given.

    • remove no longer cascades to orphaned dependencies by default: a plain removal keeps them. Use the new remove --orphans to restore the previous behavior.

    • cleanup --cache now escalates through sudo: dnf clean all clears the root-owned package cache.

  • 6.2.0 (2026-03-25)

    • Add --quiet option to all invocations to reduce log verbosity.

  • 5.20.0 (2024-11-25)

    • Add support for new dnf5 manager. Refs #1423.