Migrating AlmaLinux 8 to 9 with dnf system-upgrade
AlmaLinux 8 to 9 migration using dnf system-upgrade: disk-space checks, the upgrade command, and post-upgrade verification steps you can run immediately.
10 Apr 2026, 09:07 UTC

Problem: upgrading AlmaLinux 8 without reinstalling
You have an AlmaLinux 8 server that needs a newer library version or security baseline, but a full reinstall means downtime, reconfiguring services, and risking data loss. The dnf system-upgrade tool claims to move you to AlmaLinux 9 in a single workflow, backing up the current package set and pulling in the new release streams. The practical question is whether your system meets the hidden prerequisites before you fire that command.
Thesis: a controlled upgrade is possible if you check three things first
Before running the upgrade, confirm these conditions:
- Disk space. The upgrade process temporarily installs the new release alongside the old one, then removes the old packages. You need at least 5 GB of free space beyond what the system already uses. Check with
df -h /and compare the Avail column to your current usage. - Repository enablement. AlmaLinux 9 packages live in the BaseOS and AppStream repositories. On an 8 system these may be disabled or pointed at the 8 streams. Run
sudo dnf repolistand ensure both almalinux-baseos-9 and almalinux-appstream-9 are listed, or explicitly enable the 9 versions. - Release identity. Verify youre really on AlmaLinux 8 by reading
/etc/almalinux-release. The file should contain VERSION=8 (or VERSION_ID=8).
Worked example: the upgrade command sequence
Run all of the following as root or via sudo.
# 1. Check free space
df -h /
# 2. Enable the correct repositories (example for AlmaLinux 9)
sudo dnf config-manager --set-enabled almalinux-baseos-9 almalinux-appstream-9
# 3. Back up the current release info (optional but recommended)
cp /etc/almalinux-release /etc/almalinux-release.bak
# 4. Download the new packages without installing yet
sudo dnf system-upgrade download --releasever=9 --downloadonly
# 5. Start the upgrade and reboot into the new system
sudo dnf system-upgrade reboot --releasever=9Each step respects a meaningful placeholder: --releasever=9 tells the tool which AlmaLinux stream to target. If you omit it, DNF defaults to the current version and the command does nothing useful.
Verification after the reboot
Once the system reboots into AlmaLinux 9, run these checks to confirm the migration succeeded:
- Confirm the release:
cat /etc/almalinux-releaseshould now report VERSION=9 or VERSION_ID=9. - List repositories:
dnf repolistshould show BaseOS and AppStream enabled for the 9 stream. - Check the kernel:
uname -rshould return a version in the 5.x or 6.x series, depending on the selected AlmaLinux 9 kernel stream.
Trade-off and limitation
The convenience of a one-command upgrade comes with constraints. Rollback is not officially supported; if the upgrade fails midway, you may be left with a partially replaced package set. Third-party repositories (EPEL, custom YUM configs) that are not rebuilt for AlmaLinux 9 can cause dependency conflicts or silently remove packages. Always take a full snapshot or backup before step 4 above. If you are running critical workloads that cannot tolerate even a brief interruption, a fresh install on new hardware may be the safer engineering decision.
Actionable closing
Before you run the download command, execute the three pre-checks listed in the Thesis section, reserve the required disk space, and take a snapshot of your virtual machine or a full system tar backup. After the reboot, run the verification commands in the Verification after the reboot section and only then re-enable any third-party repos you need, rebuilding them for AlmaLinux 9 or containerizing the services they provide. If any check fails, stop the process and address the discrepancy before proceeding.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.