Skip to content
Log In Sign Up info@muvcloud.com

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 --version

The 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 autoremove removes 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

TaskYUMDNF
Installyum install nginxdnf install nginx
Removeyum remove nginxdnf remove nginx
Searchyum search nginxdnf search nginx
Detailsyum info nginxdnf info nginx
List updatesyum check-updatednf check-update
Update allyum updatednf upgrade
File owneryum providesdnf provides
Historyyum historydnf history
Repositoriesyum repolistdnf repolist
Clear cacheyum clean alldnf 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 12

Undo 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-manager and dnf needs-restarting come from the dnf-plugins-core package.

Update a Server Safely

  1. Take a snapshot.
  2. Run sudo dnf check-update to see what will change.
  3. Run sudo dnf upgrade and read the transaction summary before confirming.
  4. Run sudo dnf needs-restarting -r to 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.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

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.

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