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
| System | dnf |
|---|---|
| Fedora 40 and older | dnf 4 (dnf5 installable) |
| Fedora 41 and newer | dnf5 as dnf |
| RHEL 8, 9 and 10, Rocky, AlmaLinux | dnf 4 |
Check on a machine with dnf --version: dnf5 prints dnf5 version 5.x.
Differences that break scripts
| Area | dnf 4 | dnf5 |
|---|---|---|
| Plugins | Python plugins (dnf-plugins-core) | new plugin system; commands such as copr and config-manager reimplemented |
| config-manager | dnf config-manager --set-enabled REPO | dnf config-manager setopt REPO.enabled=1 |
| Metadata | filelists metadata loaded | filelists not loaded by default (smaller downloads) |
| Output | dnf 4 table format | different 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
Related pages
cheat sheets · homebrewHomebrew cheat sheet: install, upgrade, services and BrewfileHomebrew cheat sheet: install and remove formulae and casks, update and upgrade, pin versions, run background services, clean up, and use a Brewfile file.compare · aptapt vs apt-get: which one to useapt is the friendlier front end for interactive use, with progress bars, apt list and search; apt-get keeps a stable interface, so scripts should use it.errors · pacmanpacman: invalid or corrupted package (PGP signature)pacman stops with invalid or corrupted package (PGP signature) when archlinux-keyring is older than a packager's key. Update the keyring first, then the system.