Fedora ships a new release every six months and supports each release for thirteen months. To avoid running out of security updates, you upgrade. The blessed path is dnf system-upgrade.
Prerequisites
- Fedora N (e.g. 39) → upgrading to N+1 (e.g. 40) or N+2.
- All current updates applied (
sudo dnf upgrade --refresh -y). - An out-of-band console for headless servers. The upgrade reboots into a new initrd.
Step 1: Apply current updates first
sudo dnf upgrade --refresh -y
sudo dnf autoremove -y
sudo dnf clean all
sudo systemctl reboot # if the kernel changed
A clean N-with-all-updates is the safest starting state.
Step 2: Install the upgrade plugin
sudo dnf install -y dnf-plugin-system-upgrade
(On Fedora 41+ it is dnf5-plugin-system-upgrade.)
Step 3: Download the next release
sudo dnf system-upgrade download --releasever=40
--releasever is the version number of where you are going. Resolve any conflicts the prompt mentions (third-party repos are the usual culprit — RPM Fusion, NodeSource, Docker, etc. need the matching repo for the new release).
The download phase does NOT reboot. You can cancel cleanly with:
sudo dnf system-upgrade clean
Step 4: Reboot into the upgrade
sudo dnf system-upgrade reboot
The host reboots into a special target where DNF replaces every installed package. Headless servers must be on a console (IPMI, hypervisor) — the upgrade runs in plymouth/text. Expect 10–30 minutes depending on package count.
When it finishes, it reboots again into the new release.
Step 5: Post-upgrade housekeeping
cat /etc/fedora-release
sudo dnf autoremove -y
sudo dnf system-upgrade clean
sudo rpmconf -a # reconcile .rpmnew / .rpmsave files
rpmconf (from package rpmconf) walks you through each config file that ships a new version, so you can keep your local edits or accept upstream's new defaults.
Step 6: Re-enable held repos
Third-party repos are commonly disabled during the upgrade. Re-enable them:
ls /etc/yum.repos.d/
sudo dnf repolist --disabled | head
sudo dnf config-manager --enable rpmfusion-free-updates
Verify
cat /etc/os-release
uname -r
sudo dnf check
sudo dnf list --upgrades
Conclusion
dnf system-upgrade is the only correct path between Fedora releases. Skip a release if you must (N → N+2 works), but never skip more than that — the package conflict matrix gets unkind.
Next steps
- For the underlying tooling see DNF vs YUM.
- For long-term stability switch to Rocky Linux 9.
- Keep updated in the meantime with DNF package manager basics.
Comments
0 total · 0 threads