How to Upgrade Fedora Linux
Fedora Linux releases new versions approximately every six months. Upgrading your system is generally a straightforward process, but it’s crucial to follow the correct steps to ensure a smooth transition and avoid potential issues. This guide will walk you through the recommended way to upgrade your Fedora system from one major version to the next.
⚠️ Prerequisites & Preparation
Before you begin the upgrade process, it’s essential to prepare your system to minimize any risks.
1. Update Your Current System
Ensure your current Fedora installation is fully updated.
sudo dnf upgrade --refresh
2. Clean Up Old Packages (Optional but Recommended)
Remove any old or unnecessary packages.
sudo dnf autoremove
sudo dnf clean all
3. Backup Your Important Data
This is the most critical step. Before any major system change, always back up your personal files, dotfiles, and any critical configuration files. You can use tools like rsync, Déjà Dup, or simply copy them to an external drive.
4. Disable Third-Party Repositories (Temporarily)
Third-party repositories can sometimes cause conflicts during an upgrade. It’s best to disable them temporarily and re-enable them after the upgrade is complete.
You can list enabled repositories with:
sudo dnf repolist enabled
To disable a repository, you can either edit its .repo file in /etc/yum.repos.d/ and set enabled=0, or use dnf config-manager.
sudo dnf config-manager --set-disabled <repo-name>
🚀 The Upgrade Process
Fedora recommends using the dnf system-upgrade plugin for major version upgrades.
1. Install the DNF System Upgrade Plugin
If you don’t already have it, install the plugin:
sudo dnf install dnf-plugin-system-upgrade
2. Download the New Release Packages
Replace FEDORA_VERSION with the target Fedora release number (e.g., 43).
sudo dnf system-upgrade download --releasever=FEDORA_VERSION
This command will download all the necessary packages for the new Fedora version. If there are any dependency issues, dnf will notify you and provide solutions. You might need to add --allowerasing if there are conflicts with packages that need to be removed, but use this with caution.
3. Reboot and Upgrade
Once all packages are downloaded, initiate the upgrade by rebooting your system.
sudo dnf system-upgrade reboot
Your system will reboot into a special environment to perform the upgrade. This process can take a significant amount of time, depending on your internet speed and system specifications. Do not interrupt the process.
✅ Post-Upgrade Steps
After your system reboots into the new Fedora version, there are a few things you should do.
1. Verify the Upgrade
Check your Fedora version to confirm the upgrade was successful:
cat /etc/fedora-release
2. Re-enable Third-Party Repositories
Re-enable any third-party repositories you disabled earlier.
sudo dnf config-manager --set-enabled <repo-name>
Then, perform another update to pull in any packages from these repositories for the new Fedora version:
sudo dnf upgrade --refresh
3. Clean Up (Optional)
You might want to remove any old kernel versions or orphaned packages:
sudo dnf autoremove
Troubleshooting Common Issues
- Dependency Conflicts: If
dnf system-upgrade downloadfails due to dependency issues, try to identify the problematic packages and remove them. The--allowerasingoption can help, but ensure you understand what it’s removing. - Boot Issues: If your system fails to boot after the upgrade, you can try booting into an older kernel from the GRUB menu or a live USB to troubleshoot.
Upgrading Fedora is a relatively smooth process if you follow these steps carefully. Enjoy your updated system!