Software with dnf / yum.
dnf (the modern successor to yum, drop-in compatible) manages everything from a single package to whole groups of related software. Watch a transaction take shape, then learn how to revert it, manage repos, and pick module streams.
dnf and yum package management animated tutorial. Search, install, remove, list, info, repo files, package groups, module streams, transaction history with rollback. RHCSA EX200 ready.RHEL's package manager. Watch a transaction take shape, then learn the rollback, repo, and module commands that save you when things go sideways.
- Β·Comfortable running commands as root
- Β·Helpful: vague idea what an RPM is
- Β·Know what a software dependency is
Install, upgrade, and remove with full transaction awareness; manage repos; pick module streams; undo any transaction with dnf history.
pace: 9 minutes
nginx.x86_64 : A high performance web server β¦
Search and inspect first
Before installing anything, find out what's available and what it actually does. `dnf search <term>` matches names and summaries; `dnf info <pkg>` shows the version, size, repo, license, and description. `dnf list --installed` shows what's already on the box. These read-only commands take zero risk.
$dnf search nginx$dnf info nginx$dnf list installed | grep ssh$dnf provides /usr/bin/ssTwo habits separate fluent admins from frantic ones: read the transaction preview before typing y, and treat dnf history as your time machine. Every install/upgrade/remove is one numbered entry; undo and rollback work on any of them. You almost never need to "reinstall the OS".
$dnf search TERM$dnf info PKG$dnf provides /path/or/cmd$dnf install PKG$dnf install -y PKG$dnf remove PKG$dnf reinstall PKG$dnf upgrade [PKG]$dnf upgrade --security$dnf list installed$dnf history / info / undo / rollback$dnf repolist$dnf config-manager --set-enabled crb$dnf group list / groupinstall 'X'$dnf module enable nodejs:20$/etc/yum.repos.d/*.repoAfter an upgrade, a service stops working. What's the fastest dnf-native way to revert?
What's a dnf MODULE STREAM and why use it?
Where do repository definitions live?
What does `dnf provides /usr/bin/ss` tell you?
These aren't graded β they're just for active recall, which is what actually makes the lesson stick.
Package managers cheat sheet
Same command translated across dnf, apt, zypper, pacman β for when you switch distros and your muscle memory lies.
Read this lesson as text6 chapters Β· quiz answers
01Search and inspect first
Before installing anything, find out what's available and what it actually does.
dnf search <term>matches names and summaries;dnf info <pkg>shows the version, size, repo, license, and description.dnf list --installedshows what's already on the box. These read-only commands take zero risk.$ dnf search nginxβ match names + summaries$ dnf info nginxβ version, size, license, desc$ dnf list installed | grep sshβ what's installed$ dnf provides /usr/bin/ssβ which package owns this file
02Install β and read the transaction preview
dnf install nginxshows you the FULL transaction before doing anything: the package itself, every dependency it pulls in, the size, and the total download. Type 'y' to confirm or 'N' to bail. -y skips the prompt (use in scripts, never blindly). Always read the list β that's where you catch unintended dependencies.$ dnf install nginxβ with confirmation$ dnf install -y nginxβ no prompt (scripts)$ dnf reinstall nginxβ restore overwritten files$ dnf remove nginxβ uninstall (incl. unused deps)
03Update and check
dnf check-updatelists packages with newer versions available β exit 0 = nothing, 100 = updates available (useful in scripts).dnf upgrade(orupdateβ synonyms) downloads and installs them. By default it upgrades EVERYTHING; name a specific package to upgrade just that.dnf upgrade --securityis the focused version for CVE patching.$ dnf check-updateβ what's available?$ dnf upgradeβ upgrade everything$ dnf upgrade nginxβ just one$ dnf upgrade --securityβ only CVE fixes
04Repositories β where packages come from
Each .repo file in /etc/yum.repos.d/ defines a repository: a name, a baseurl (or mirrorlist), and whether it's enabled.
dnf repolistshows the active ones.dnf config-manager --add-repo URLadds one;--set-enabled / --set-disabled NAMEtoggles. Third-party repos (EPEL, RPM Fusion) ship as packages β installing them drops their .repo file in for you.$ dnf repolistβ enabled repos$ dnf repolist --allβ incl. disabled$ dnf install epel-releaseβ add EPEL via package$ dnf config-manager --set-enabled crbβ enable a repo$ ls /etc/yum.repos.d/β where repos live
05Groups and module streams
A
groupis a curated bundle (e.g. "Development Tools" = gcc + make + autoconf + β¦).dnf groupinstall 'Development Tools'pulls the lot. Amodule(RHEL 8+) is a versioned stream of an app β pick which major version of nodejs, postgresql, or ruby to install withdnf module enable <name>:<stream>beforednf install. Modules let one repo offer multiple parallel versions.$ dnf group listβ available groups$ dnf groupinstall 'Development Tools'β install a group$ dnf module listβ all modules$ dnf module enable nodejs:20β pin a stream$ dnf module reset nodejsβ unpin
06History β every transaction is reversible
Every dnf transaction (install, upgrade, remove) gets a numbered entry in
dnf history. View one withdnf history info <id>. Undo withdnf history undo <id>β it reverses the changes (uninstalls what was installed, reinstalls what was removed).dnf history rollback <id>rolls the whole system back to that point. This is your safety net after a bad upgrade.$ dnf historyβ list transactions$ dnf history info 7β what did tx #7 do$ dnf history undo 7β reverse just that tx$ dnf history rollback 5β roll back to that point
Quiz β answers
- After an upgrade, a service stops working. What's the fastest dnf-native way to revert?
- βdnf history list, find the bad transaction ID, dnf history undo <id> (or rollback to a prior id).Every dnf transaction is recorded.
history undoreverses one tx;history rollback <id>brings the system back to the state right after that earlier tx. It's the closest thing to git revert/reset for packages. - What's a dnf MODULE STREAM and why use it?
- βA versioned variant of a package shipped in one repo β e.g. nodejs:20 vs nodejs:18. Pick one with
dnf module enable nodejs:20so a single repo can offer multiple major versions without conflict.Modules + streams let RHEL ship multiple major versions of the same app from one repo. Enable a stream, then install β the right version comes in. Reset the module to unpin. - Where do repository definitions live?
- β/etc/yum.repos.d/*.repo (each file is one or more repos with name, baseurl, enabled, gpgcheck).Each .repo file under /etc/yum.repos.d/ defines a repo.
dnf repolistshows the enabled ones. Add new ones withdnf config-manager --add-repo URLor by installing a vendor 'release' package (epel-release, etc.). - What does
dnf provides /usr/bin/sstell you? - βWhich package provides (owns) the file /usr/bin/ss β useful for figuring out 'I need this command, what do I install?'
dnf providesdoes a reverse lookup from a file path or capability to the package that supplies it. Great when you know the command name but not the package name.
keep going β these pair well with what you just learned.
SELinux contexts
Why Apache can't read your file. Watch the policy engine decide β and learn the workflow for fixing denials. RHCSA-ready.
Linux boot process
From power button to login prompt. Every stage in the chain β UEFI, GRUB, kernel, initramfs, systemd β with the rescue moves that save you. RHCSA-ready.
LVM stacking
Layer-by-layer build of an LVM stack: disks β PVs β VG β LVs β filesystem. Then extend live and snapshot. RHCSA-ready.