Skip to content

/compat/dnf/dnf4-vs-dnf5

dnf 4 vs dnf5: which Fedora and RHEL releases use which

The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
tool
dnf
versions
dnf 4, dnf5
os
linux

dnf5 is a rewrite of the DNF package manager in C++. Fedora 41 made it the default: the dnf command now runs dnf5, and yum points to it as well. Red Hat Enterprise Linux 9 and 10 and their rebuilds still ship dnf 4. Most everyday commands are the same; plugins, some options and output formats differ.

Which system uses which

Systemdnf
Fedora 40 and olderdnf 4 (dnf5 installable)
Fedora 41 and newerdnf5 as dnf
RHEL 8, 9 and 10, Rocky, AlmaLinuxdnf 4

Check on a machine with dnf --version: dnf5 prints dnf5 version 5.x.

Differences that break scripts

Areadnf 4dnf5
PluginsPython plugins (dnf-plugins-core)new plugin system; commands such as copr and config-manager reimplemented
config-managerdnf config-manager --set-enabled REPOdnf config-manager setopt REPO.enabled=1
Metadatafilelists metadata loadedfilelists not loaded by default (smaller downloads)
Outputdnf 4 table formatdifferent layout; do not parse it

For scripts that must work on both, prefer commands that exist in both (install, remove, upgrade, repoquery) and test with each version. For machine-readable data use rpm -q --queryformat or dnf repoquery --qf.

Sources