The Short Answer
On AlmaLinux and Rocky Linux 8 and later, yum is a link to dnf. You can check it yourself:
ls -l /usr/bin/yum
dnf --versionThe link points to dnf-3, the same program that dnf starts. Both names read the same configuration and the same repository files, and accept the same options. There is nothing to choose between on a current server: use dnf, and leave existing scripts alone.
A Short History
YUM (Yellowdog Updater, Modified) managed packages on Red Hat Enterprise Linux and its rebuilds for well over a decade. It was written in Python and used its own dependency resolver, which grew slow and hard to predict with many repositories. DNF began as a fork of YUM, became the default in Fedora 22 in 2015, and replaced YUM in Red Hat Enterprise Linux 8 and the systems built from it. Fedora 41 moved on to DNF5, a rewrite. AlmaLinux and Rocky Linux 8, 9, and 10 still ship DNF 4, so everything on this page applies to them.
What Changed Under the Hood
- Dependency solver: DNF uses libsolv, a SAT-based solver, so it settles dependencies faster and gives the same answer for the same input.
- Clear errors: when a transaction cannot be solved, DNF explains which packages conflict.
- Unused dependencies:
dnf autoremoveremoves packages that were installed only as dependencies and are no longer needed. - Stable interface: plugins and other tools use a documented library instead of YUM's internals.
Equivalent Commands
| Task | YUM | DNF |
|---|---|---|
| Install | yum install nginx | dnf install nginx |
| Remove | yum remove nginx | dnf remove nginx |
| Search | yum search nginx | dnf search nginx |
| Details | yum info nginx | dnf info nginx |
| List updates | yum check- | dnf check- |
| Update all | yum update | dnf upgrade |
| File owner | yum provides | dnf provides |
| History | yum history | dnf history |
| Repositories | yum repolist | dnf repolist |
| Clear cache | yum clean all | dnf clean all |
dnf update still works as another name for dnf upgrade. Add sudo to anything that changes the system.
Undo a Transaction with History
DNF records every transaction. List them, look at one, and reverse it:
dnf history list
dnf history info 12
sudo dnf history undo 12Undo installs what was removed and removes what was installed. It needs the older package versions to still be available in the repositories, and it cannot cleanly reverse every update, kernels in particular. A snapshot taken before the change is the reliable way back; see snapshot vs backup.
Configuration and Repositories
- Main settings:
/etc/dnf/dnf.conf. - Repository files: still in
/etc/yum.repos.d/, a name kept for compatibility. - Extra repositories: EPEL installs with
sudo dnf install epel-release. As with any extra repository, you trust its publisher with root on the server. - Plugins:
dnf config-manageranddnf needs-restartingcome from thednf-plugins-corepackage.
Update a Server Safely
- Take a snapshot.
- Run
sudo dnf check-updateto see what will change. - Run
sudo dnf upgradeand read the transaction summary before confirming. - Run
sudo dnf needs-restarting -rto learn whether a reboot is needed, then follow how to reboot a Linux server.
Where apt Fits
DNF and YUM belong to the Red Hat family. Debian and Ubuntu use apt instead; its everyday commands are in sudo apt update. For choosing between the two main rebuilds, see AlmaLinux vs Rocky Linux.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations