DNF and RPM
Fedora and RHEL-family systems' package stack - rpm installs individual .rpm packages, while DNF (the successor to YUM) handles dependency resolution and repositories on top.
The same two-layer pattern as APT and dpkg: a low-level tool for individual package files, and a higher-level tool that manages repositories and dependencies.
rpm: the low-level tool
sudo rpm -i package.rpm # install a local .rpm file
rpm -qa # list all installed packages
rpm -ql nginx # list every file nginx's package installed
rpm -qf /usr/sbin/nginx # which package owns this file?
Like dpkg, rpm alone won't fetch missing dependencies from a
repository - it'll just refuse to install if something required is
missing.
DNF: the layer you actually use
DNF replaced YUM as the default package manager starting with Fedora 22,
and is now standard across current Fedora, RHEL, CentOS Stream, and Rocky/
AlmaLinux. yum is still available as a compatibility alias on many
RHEL-family systems, forwarding to DNF underneath - you'll see both
names in documentation of varying age.
sudo dnf check-update # see what's available without installing
sudo dnf upgrade # upgrade all installed packages
sudo dnf install nginx # install, resolving dependencies automatically
sudo dnf remove nginx # remove a package
sudo dnf search "web server" # search package names and descriptions
dnf info nginx # details about a specific package
Unlike apt, there's no separate "refresh the index" step required before
install - DNF checks repository metadata staleness automatically and
refreshes it as needed.
Repositories
/etc/yum.repos.d/*.repo
Each .repo file defines one repository: a name, base URL or mirror
list, and GPG key for verifying package signatures. Adding a third-party
repository (RPM Fusion is a common example on Fedora, for packages that
can't ship in the main repos for licensing reasons) means adding a
.repo file here.
DNF's history feature
A DNF-specific convenience worth knowing: every transaction is logged and individually reversible.
dnf history
ID | Command line | Date and time | Action(s)
12 | install nginx | 2026-08-20 09:14 | Install
11 | upgrade | 2026-08-15 06:00 | Upgrade
sudo dnf history undo 12 # revert transaction 12 specifically
This makes recovering from a bad upgrade or an accidental install considerably less manual than reconstructing what changed by hand.
Package groups
RPM-based distros also support installing curated bundles of packages by purpose:
dnf group list
sudo dnf group install "Development Tools"
"Development Tools" is the RHEL-family equivalent of Debian/Ubuntu's
build-essential metapackage - see
Building From Source for why
you'd need it.
Version pinning
sudo dnf install 'dnf-command(versionlock)'
sudo dnf versionlock add nginx
Requires the versionlock plugin, not built in by default the way
apt-mark hold is - install it once, then use it the same way you'd hold
a package on Debian/Ubuntu.