Kennisbank › Pakketbeheer › dnf: Package Management
pakketbeheer starter 22 September 2026

dnf: Package Management

You type `dnf install nginx` and it works. You rarely think about what sits underneath that command, until the day it doesn't work and you have to.DNF —

You type `dnf install nginx` and it works. You rarely think about what sits underneath that command, until the day it doesn't work and you have to.

DNF — Dandified YUM — is the package manager you meet on Fedora, RHEL 8 and later, Rocky Linux, AlmaLinux, and anything else built on that lineage. If you administer one of those systems, you already use it. The question this piece answers is not "how do I run dnf" but "why this one, and what does choosing it cost me."

Start with what it replaced. YUM did the job for years, and it did it slowly. Dependency resolution was the weak point: on a large transaction with many interlocking requirements, YUM could take minutes to work out what to install, and it sometimes got it wrong. DNF was written to fix exactly that, and it does.

The first public release landed on 9 March 2012, in the `rpm-software-management/dnf` repository on GitHub. That date matters less than what followed: years of quiet replacement, distribution by distribution.

Fedora 18 shipped DNF as an option. You could still pick YUM. Fedora 22, in May 2015, made DNF the default. That is the moment the switch became real for most people — not a new tool you could try, but the tool you got whether you asked or not.

RHEL 8 followed in 2019. That is the step that pushed DNF beyond the Fedora community and into every shop running Red Hat enterprise software. And because Rocky Linux and AlmaLinux are built to be binary-compatible with RHEL, they inherited DNF too, along with the version numbering: Rocky 8 and 9 track RHEL 8 and 9, with ten years of support per major release.

So the practical upshot: learn DNF once and your knowledge carries across Fedora, RHEL, Rocky, AlmaLinux, Oracle Linux, and the rest. That portability is the real argument for it, more than any single feature.

Now the features, and what each one costs you.

Automatic dependency resolution is the core. You ask for a package, DNF works out everything else that has to come along, and it does so faster than YUM did. This is the part you notice when it's missing. On a system without it you spend your afternoon reading "unresolved dependency" messages and installing libraries by hand.

The cost is that DNF will sometimes want to remove things you didn't expect, or pull in a package you'd rather not have. When that happens you have to read the transaction summary before you confirm it. DNF prints one. People who press `y` without reading it are the same people who file bug reports about a package manager that "broke my system."

Modules are the second thing worth knowing. They let you run multiple versions of the same software side by side — different Python releases, different Node.js releases — by selecting a stream. On RHEL 8 and its clones this was the standard way to get a newer language runtime than the base repository shipped.

It is also the feature that caused the most confusion. Module streams have their own enable and disable logic, and mixing a module stream with a package from a third-party repository is a reliable way to produce a dependency conflict that reads like nonsense. RHEL 9 and later lean on AppStream repositories and flatpak instead, and modules are being phased out. If you are starting fresh on RHEL 9 or Rocky 9, you may never touch them.

Comps groups and environments are the third. A group is a bundle of related packages — "Web Server," "Graphical Desktop" — and an environment is a group of groups. `dnf group install` sets up a whole role in one command instead of thirty.

The cost is that groups install more than you need. A "Web Server" group on a minimal image brings in documentation, extra tooling, and packages you will never call. On a container base image that bloat is real: hundreds of megabytes you then have to strip back out. Groups are convenient on a workstation and a liability on a slim server.

One more thing DNF does that surprises people coming from other package managers: it keeps a history. Every transaction is recorded, and `dnf history` shows you what happened, when, and what it changed. `dnf history undo` reverses a transaction. That is a genuine safety net, and it is the reason a bad upgrade on Fedora is usually recoverable rather than fatal.

The cost is disk. The DNF cache and the history database grow, and on a small VM you notice. `dnf clean all` clears the cache; the history is smaller and you can leave it.

Then there is the repository question, which is where DNF stops being neutral.

DNF itself is open source, maintained in the open, and works with any RPM repository you point it at. But the repositories you actually use are a policy decision. RHEL gives you Red Hat's supported channels and a subscription to pay for. Rocky and AlmaLinux give you rebuilds of those same packages, free, maintained by their respective foundations — Rocky by the Rocky Enterprise Software Foundation, AlmaLinux by the AlmaLinux OS Foundation with backing from CloudLinux.

Both are legitimate. Red Hat's channels come with vendor support contracts, certification, and someone to call. The rebuilds come with none of that, and with the small risk that a rebuild lags or diverges. For most workloads the divergence never matters. For regulated environments it sometimes does.

Fedora sits upstream of all of it. It is where DNF gets tested first, on a six-month release cycle with roughly thirteen months of support per version. That cadence is the point and also the problem: you get new DNF behaviour early, and you reinstall or upgrade every year whether you wanted to or not. Fedora is a fine desktop and a poor choice for a server you want to leave alone.

What you actually choose between, then, is not DNF versus something else. It is which distribution ships it, and how much churn you are willing to absorb in exchange for how much support.

A stable enterprise base means older packages and a slower DNF. A fast-moving community distribution means newer packages and a DNF that changes under you. A free rebuild means the same commands and no invoice, and also no one contractually obliged to answer when a rebuild breaks.

Pick the one whose failure mode you can live with. That is the whole decision, and DNF will behave the same way on all of them.

← Terug naar kennisbank
← Terug naar kennisbank