Mastering the heart of AlmaLinux administration: the dnf5 package manager with its basic commands, dnf5.conf configuration, history and rollback, plus managing the BaseOS, AppStream, CRB, Extras, and EPEL repositories, up to the official dnf-almalinux plugin.

In the previous episode, Episode 3, we installed AlmaLinux and prepared our first system. Now we get into a skill you'll use every day: package management. Almost all administrative work — installing software, updating the system, adding repositories — revolves around the package manager. On AlmaLinux 9 and 10, that tool is called dnf5, the modern successor to classic dnf.
This episode breaks down dnf5 from basic commands to advanced features like history and rollback, then explains the repository ecosystem that serves as the source of packages on your system.
DNF5 is the new generation package manager that merges dnf and libdnf into a single, faster, more memory-friendly executable. On AlmaLinux 10 it's the default; on AlmaLinux 9 it's available as an option. Its main commands remain familiar — the difference is in speed and ease of use.
dnf5 --versionThese are the five commands you'll use most often:
| Command | Function |
|---|---|
sudo dnf5 install <pkg> | Installs a package along with its dependencies |
sudo dnf5 remove <pkg> | Removes a package |
dnf5 search <keyword> | Searches for packages by name or description |
sudo dnf5 upgrade | Updates all system packages |
dnf5 repoquery --installed <pkg> | Queries details of an installed package |
sudo dnf5 install -y htop git
dnf5 search cockpit
dnf5 repoquery --installed kernelThe -y flag answers "yes" automatically for confirmations — convenient for scripting, but get in the habit of reading what will be installed first.
To find out which package provides a file or command, use repoquery:
dnf5 repoquery --whatprovides /usr/sbin/semanage
dnf5 repoquery --whatprovides ifconfigBoth examples above show the classic way to answer the question "which package provides this utility?" — a skill that helps a lot when a tutorial asks for a package you don't recognize.
The global dnf5 configuration lives in /etc/dnf/dnf5.conf. Some options you'll often adjust:
| Option | Function |
|---|---|
keepcache=1 | Keeps downloaded package cache |
fastestmirror=1 | Automatically picks the fastest mirror |
max_parallel_downloads=N | Number of parallel downloads |
gpgcheck=1 | Mandatory GPG signature verification (default, don't disable) |
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=Trueinstallonly_limit=3 keeps up to three versions of packages that can be installed side by side — very important for the kernel, because you can boot to an older version if a new one misbehaves.
Installation mistakes are normal. dnf5 keeps a transaction history that lets you return to a previous state:
dnf5 historyThe output contains a list of transactions with their IDs, dates, and the number of changed packages. To view the details of one transaction:
dnf5 history info <ID>
sudo dnf5 history undo <ID>history undo reverses a given transaction — returning packages to their previous versions. This is a safety net that most installers don't have.
Warning
Rollback is not a replacement for backup. If a changed package touches configuration files (for example a kernel or glibc update), the rollback result may be imperfect. Always create a snapshot or backup before major changes.
Packages come from repositories — centralized package sources. AlmaLinux ships with built-in repositories already configured in /etc/yum.repos.d/almalinux.repo.
dnf5 repolist| Repository | Role |
|---|---|
| BaseOS | Core operating system packages (kernel, glibc, systemd) |
| AppStream | Applications and runtimes, supporting multiple versions |
| CRB (CodeReady Builder) | Developer tooling and build dependencies |
| Extras | Additional packages not in the two main repositories |
| Devel | AlmaLinux's internal development packages |
AppStream and its module concept will be covered in more depth in episode 5.
sudo dnf5 config-manager setopt crb.enabled=1CRB is often needed to build software from source. Extras is usually enabled by default. Don't hesitate to enable CRB when build tooling asks for it — and disable it again when it's not needed.
sudo dnf5 install epel-releaseWarning
Every third-party repository expands your system's trust surface. Only add repositories you genuinely need, and make sure they use valid GPG signing.
dnf-almalinux is the official plugin and tools developed by AlmaLinux for distribution needs. One of its functions is simplifying repository and version information management. To ensure the security of all packages, get in the habit of verifying GPG signatures from time to time:
rpm -qa --qf '%{NAME} %{SIGPGP:pgpsig}\n' | headOfficial AlmaLinux packages are signed with the GPG key stored at /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux. A valid signature is the first line of defense against tampered packages.
dnf5 upgrade without reading. Always review the list of packages that will change before approving — especially when it involves the kernel or critical services.gpgcheck. This opens the door to fake packages. Never do it.dnf5 history. The rollback feature is your best friend — get used to using it when experimenting.-y flag deliberately. On production systems, it's sometimes safer to let dnf ask for confirmation so you read every change.In this episode 4 you've mastered package management with dnf5: the basic install, remove, search, upgrade, and repoquery commands, dnf5.conf configuration, transaction history and rollback, managing the BaseOS, AppStream, CRB, Extras, and EPEL repositories, up to the official dnf-almalinux plugin and GPG verification.
Key takeaways:
dnf5 install, remove, search, upgrade, repoquery.dnf5 history gives you the ability to undo/rollback transactions.Package management is your operational foundation. In the next episode, Episode 5, we'll cover Modules (AppStream) & Software Collections — how a single repository can offer many versions of Python, Node.js, or PostgreSQL at once, when to use a module stream, and the Software Collections legacy of the 8.x era that is now replaced by AppStream. See you there!