DNF and YUM: Package Management on RHEL-Family Servers Explained
DNF replaced YUM as the default package manager on RHEL-family systems, yet yum still runs. Master search, install, groups, history, and repo management.
Netbay Infrastructure Team
Netbay Engineering
On this page
On an RHEL-family server — RHEL, Rocky, AlmaLinux, CentOS Stream — the package manager is the tool you will touch more than any other, and it changed quietly underneath a decade of muscle memory. DNF became the default in EL8 and is the only option in EL9, yet typing yum still works perfectly. Understanding what actually runs when you type yum, plus the repo, group, and history machinery underneath, turns package management from incantation into a system you can reason about.
One Binary, Two Names
The yum command on Rocky or AlmaLinux 9 is dnf. The compatibility is deliberate: scripts, documentation, and decades of habits keep working.
which yum
readlink -f /usr/bin/yum
rpm -qf /usr/bin/yum
dnf --versionOn EL8 and EL9 the path resolves to dnf-3, a Python 3 reimplementation that mirrors the old YUM command line: same subcommands, same output style, same exit codes. That is why legacy yum documentation keeps working years after the cutover. The change is underneath, where dnf uses the libsolv solver — dramatically faster on large transactions and more correct than YUM's resolver, which occasionally produced surprising dependency choices on big upgrades.
The Commands That Matter Daily
dnf search postgresql
dnf info postgresql-server
sudo dnf install -y postgresql-server
sudo dnf remove postgresql-server
sudo dnf upgrade
sudo dnf upgrade --securityTwo habits worth building early. First, prefer dnf upgrade over the synonym dnf update — upgrade is the documented spelling going forward, and new documentation uses it exclusively. Second, reach for --security when you want errata without feature churn: it scopes the transaction to packages with published security advisories, which is exactly the right size for a server you do not want to surprise.
Repositories: Where Packages Come From
Every package dnf offers comes from a repository: a URL plus metadata describing the available packages and their dependency graph.
dnf repolist
dnf repoinfo baseos
sudo dnf config-manager --set-enabled crb
sudo dnf makecacheEL9 ships with BaseOS for the core userland, AppStream for applications, languages, and databases, and CRB (CodeReady Builder) for build-time dependencies — all configured by drop-in files under /etc/yum.repos.d. Third-party repositories such as EPEL, the Docker CE repo, or PostgreSQL's own plug in the same way, and dnf config-manager toggles them without hand editing. When metadata goes stale or a mirror misbehaves, dnf clean all followed by dnf makecache resets the local view of the world.
Groups and Modules
dnf group list
sudo dnf group install -y "Development Tools"
dnf module list
sudo dnf module enable -y nodejs:20Groups bundle dozens of related packages into one transaction — "Development Tools" on a fresh box saves an afternoon of picking compilers one at a time. Modules solve the orthogonal problem of shipping several versions of one stack, like Node.js 18 and 20, in a single distribution without conflicts. EL9 flattened most modular content into AppStream, but EL8 servers will keep modules relevant for years, and knowing the syntax will save you when you inherit one.
History: Every Transaction Is a Ledger Entry
dnf history
dnf history info 42Every install, remove, or upgrade becomes a numbered transaction with a timestamp, the invoking user, and the complete package delta. This ledger is not just for audits: dnf can undo a single transaction or rewind the whole system to a known-good one. We cover that machinery in detail in the post on rolling back updates with dnf history.
Hygiene
sudo dnf autoremove
dnf list installed | wc -lRun autoremove after large removals to drop dependencies that nothing needs anymore. Review its output rather than firing it blind from cron — occasionally a "dependency" is something you actually wanted, and autoremove is the fastest way to find that out the hard way.
Takeaway: DNF kept YUM's interface and replaced its brain. Learn the repo layout and the history ledger, and you can predict, audit, and reverse anything the package manager does. Every Netbay Rocky and AlmaLinux image arrives with a clean, current dnf database — deploy a VPS in under 60 seconds at netbayhosts.in and put these commands on a real machine.
Keep reading
Follow along on a real VPS
Deploy Linux in under 60 seconds
These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.
Deploy an instance