With Fedora 41 and onwards, the traditional dnf
package manager is replaced by dnf5
, introducing a faster and more efficient system for managing packages. One of its most important features is the dnf5 system-upgrade command, which makes upgrading to a newer Fedora release much easier while ensuring improved performance and reliability. By following this guide, you’ll learn to confidently upgrade your Fedora system using the dnf5 system-upgrade command, troubleshoot common issues, and ensure a smooth transition to the latest release.
This guide explains how to use the dnf5 system-upgrade
command to upgrade Fedora seamlessly, with step-by-step instructions and troubleshooting tips.
What is the dnf5 system-upgrade command?
The dnf5 system-upgrade
plugin is a powerful tool introduced in Fedora 41 and later to streamline the process of upgrading from one Fedora release to another. The dnf5 system-upgrade command simplifies the upgrade by automating the download and installation of necessary packages and applying changes during a system reboot.
This plugin allows users to transition smoothly to a newer Fedora release without needing to reinstall the operating system manually. It handles complex tasks like dependency resolution, package replacements, and kernel upgrades, ensuring a seamless experience for users.
Key Benefits of Using dnf5 system-upgrade:
- Efficient Process: Automatically downloads and installs all required updates for the target Fedora release.
- Reduced Risks: Handles potential conflicts by providing options like
--allowerasing
to resolve package issues during the upgrade. - User-Friendly: Requires minimal user intervention, making it accessible for both new and experienced users.
The dnf5 system-upgrade
plugin is an essential tool for Fedora 41 and onwards users who want to keep their systems updated with the latest features, performance improvements, and security patches. Using the dnf5 system-upgrade command ensures your system stays current with minimal effort.
Crucially, before proceeding, always review the official Fedora release notes for the specific version you are upgrading to. These notes contain vital information about significant changes, potential issues, and deprecated features that could impact your system. Visit Fedora’s official documentation for the latest release notes.
Pre-Upgrade Preparation
Preparation is essential to ensure a smooth and successful system upgrade. Follow these steps to ready your system:
Update Your Current System
Before starting the upgrade, make sure your system is fully up-to-date. This minimizes potential conflicts and ensures a stable starting point for the upgrade process. Run the following command to update all installed packages:
sudo dnf5 update --refresh
This command refreshes metadata and installs the latest versions of all available updates for your current Fedora release.
Back Up Important Data
System upgrades carry inherent risks, so it’s crucial to back up any important files or configurations. Use an external storage device or a reliable cloud service to safeguard your data. This precaution ensures you can recover your information in case of an unexpected issue during the upgrade.
Check System Requirements
Ensure your system meets the following requirements for a successful upgrade:
- Stable Internet Connection: Upgrading requires downloading several packages, so a reliable connection is essential.
- Sufficient Disk Space: Verify that your system has enough free space to accommodate the new packages. Use the command below to check disk usage:
df -h
If disk space is low, delete unnecessary files or transfer large files to external storage.
Disable Third-Party Repositories
Third-party repositories can sometimes cause conflicts during upgrades. Temporarily disable them with this command:
sudo dnf5 config-manager --disable <repository_name>
After the upgrade is complete, you can re-enable these repositories to restore additional functionality.
Review Fedora Release Notes
Before proceeding, review the release notes for the Fedora version you’re upgrading to. Release notes provide critical information about new features, deprecated packages, and potential compatibility issues that might impact your setup. Visit Fedora’s official documentation for the latest release notes.
Pro Tip: Ensure your system is plugged into a stable power source during the upgrade to avoid interruptions, especially for laptops.
How to Use the dnf5 system-upgrade command
The dnf5 system-upgrade
plugin simplifies upgrading Fedora by automating package downloads and applying the upgrade during a system reboot. Follow these steps to upgrade your Fedora system safely and efficiently:
Step 1: Install the dnf5 system-upgrade Command Plugin
First, ensure the dnf5-plugin-system-upgrade
package is installed. This plugin provides the necessary tools for the upgrade. While it may be pre-installed on Fedora 41+ systems, running the command below guarantees its availability:
sudo dnf5 install dnf5-plugin-system-upgrade
This command ensures the required plugin is available for managing the system upgrade process.
Step 2: Download Upgrade Packages with dnf5 system-upgrade command
Next, download all the necessary packages for the target Fedora release. Replace <target_version>
with the Fedora version number you wish to upgrade to (e.g., 42
):
sudo dnf5 system-upgrade download --releasever=<target_version>
If package conflicts occur, use the --allowerasing
option. This powerful flag allows DNF5 to remove or replace conflicting packages, which is often necessary for a successful upgrade. While generally safe for standard system upgrades, be mindful that it will remove packages; advanced users with critical custom packages may want to review the proposed changes carefully:
sudo dnf5 system-upgrade download --releasever=<target_version> --allowerasing
Adding the --allowerasing
flag prevents the upgrade process from failing due to package conflicts.
Step 3: Reboot and Apply the Upgrade Using dnf5 system-upgrade command
After successfully downloading the upgrade packages, reboot your system to initiate the upgrade:
sudo dnf5 system-upgrade reboot
During the reboot, your system will boot into a special upgrade environment (often visible with a progress bar or messages on a dark screen) where it applies the downloaded packages. This offline process finalizes the upgrade and can take some time depending on your system and the number of updates. Do not interrupt it.
Pro Tip: Ensure your system has a stable power supply during this step to avoid interruptions. For laptops, keep the charger connected.
Post-Upgrade Steps
After completing the upgrade, it’s essential to verify the system, re-enable any previously disabled repositories, and clean up leftover files. Follow these steps to finalize the process:
Verify the Upgrade
Start by confirming that your system is running the upgraded Fedora version. Use the following command to check the current release:
cat /etc/os-release
This command displays the Fedora version and release information. If the version doesn’t match your target release, troubleshoot the upgrade logs or consider re-running the upgrade process. For advanced troubleshooting or unique issues, consult the official Fedora documentation for the most up-to-date guidance.
Re-enable Disabled Repositories
If you disabled third-party or custom repositories during the upgrade, re-enable them to restore full system functionality:
sudo dnf5 config-manager --enable <repository_name>
Clean Up the System
To ensure optimal performance and free up disk space, remove unused or obsolete packages and clear cached files:
- Remove unnecessary packages:
sudo dnf5 autoremove
- Clean up cached files:
sudo dnf5 clean all
This command removes cached package files, metadata, and other temporary data, helping to free up significant disk space and maintain a tidy system.
Test Your Applications
Run your critical applications to verify that they work as expected. Pay special attention to any software with dependencies that may have been updated during the upgrade. If issues arise, consider reinstalling the affected application or checking the Fedora documentation for compatibility updates.
Pro Tip: If you use custom configurations or third-party software, check their compatibility with the new Fedora release to avoid disruptions in your workflow.
Troubleshooting dnf5 system-upgrade command Issues
Even with careful preparation, you may encounter issues during or after the system upgrade. Below are common problems and actionable solutions to address them.
Missing Dependencies or Package Conflicts
Package conflicts can occur if certain packages are incompatible with the target Fedora release. To resolve this, use the --allowerasing
option when downloading the upgrade packages. This option allows conflicting packages to be replaced or removed automatically:
sudo dnf5 system-upgrade download --releasever=<target_version> --allowerasing
If the issue persists, review the error output to identify the conflicting packages. Uninstall them manually before retrying the upgrade.
Insufficient Disk Space
Running out of disk space is a frequent issue during upgrades. You can free up space by removing unused packages and clearing the package cache:
- To remove unused packages:
sudo dnf5 autoremove
- To clear cached package files:
sudo dnf5 clean packages
Additionally, check your current disk usage to identify large files or directories:
df -h
System Fails to Boot
If your system fails to boot after the upgrade, you can recover by booting into a previous kernel from the GRUB menu. Follow these steps:
- Restart your system and access the GRUB menu by holding the
Shift
key or tapping theEsc
key during boot. - Select an earlier kernel version from the list.
Once booted, check the system logs to identify the cause of the issue:
journalctl -xb
Preventative Tip: To minimize the risk of boot failures, ensure your kernel and critical system files are updated before starting the upgrade process:
sudo dnf5 update --refresh
Conclusion
Using the dnf5 system-upgrade command is a straightforward and reliable way to upgrade your Fedora system to the latest release. This guide has provided a step-by-step approach to ensure a smooth process, from preparation to troubleshooting. By following these steps, you can take full advantage of the new features, performance enhancements, and security updates that Fedora has to offer.
Have you used the dnf5 system-upgrade
command to upgrade Fedora? Share your experiences or tips to help other readers in the comments below!
The argument –set-disabled for config-manager command doesn’t exist in my version of DNF5.
Is this a problem for others aswell? I manually # out 3rd party repos
Hi Rou,
Thanks for flagging this! In recent versions of DNF5 the
--set-disabled
flag was replaced by a simpler--disable
option. For example, to disable a repo you’d run:And to re-enable it:
If you still see an error, make sure the config-manager plugin is installed:
As an alternative you can also edit the relevant
.repo
file in/etc/yum.repos.d/
and setenabled=0
under the repo you wish to disable.I’ll update the guide to use the current flags—hope that helps!