Upgrading Fedora with DNF System Upgrade: Fast, Clean, and No Fear of ‘Bricking’ Your System

Fedora tutorial - IT technology blog
Fedora tutorial - IT technology blog

Why I Choose Upgrading Over a Fresh Install

Fedora is famous for its “lightning-fast” release cycle. Approximately every 6 months, a new version appears. I have been using Fedora as my primary development machine for over 2 years. The biggest advantage is that the Kernel, GCC, Python, and Go are always updated to the latest versions extremely quickly.

However, the support lifecycle for each Fedora release lasts only about 13 months. This means at least once a year, you must upgrade to continue receiving security patches. Many DevOps engineers are often hesitant to upgrade their OS for fear of dependency errors or losing important configurations.

In reality, the dnf-plugin-system-upgrade tool handles this very smoothly. Instead of spending 2 hours reinstalling the system and setting up the environment, an in-place upgrade keeps your Docker containers, Nginx configurations, and SSH keys intact. If you follow the process correctly, the error rate is virtually zero.

3 Preparation Steps to Avoid Headaches

Before typing any commands, double-check these 3 factors to ensure the upgrade process goes smoothly:

  • Backup your data: Even though DNF is very stable, don’t be careless. Copy important folders like /etc, /var/www, and /home to an external drive or the Cloud.
  • Clear storage space: An upgrade usually downloads about 2.5GB – 5GB of packages. Ensure your root partition (/) has at least 10GB of free space.
  • Temporarily disable external Repos: Third-party repositories (except for RPM Fusion) can easily cause version conflicts during dependency calculation.

Installing the System Upgrade Tool

To upgrade between major versions (e.g., from 40 to 41), you need a dedicated DNF plugin. This plugin manages package downloads and sets up a safe reboot environment.

First, bring your current system to the latest state:

sudo dnf upgrade --refresh

After the update is complete, if there is a new Kernel, you should reboot once. Next, install the upgrade plugin using the command:

sudo dnf install dnf-plugin-system-upgrade

Downloading Packages for the New Version

This is the phase where the system prepares the data. Suppose you are on Fedora 40 and want to move to Fedora 41; run the following command:

sudo dnf system-upgrade download --releasever=41

Here, --releasever=41 is the target version number. DNF will start checking metadata and listing the thousands of packages that need to be downloaded.

Handling Dependency Conflicts

If you encounter the error “Problem: package X requires Y…”, the cause is usually old packages from external repos. You can add the --allowerasing flag to allow DNF to automatically remove the packages causing the bottleneck:

sudo dnf system-upgrade download --releasever=41 --allowerasing

Note: Read the list of packages to be removed carefully. If you see it planning to delete an important IDE or Database engine, stop and check manually.

Proceeding with the Upgrade and Reboot

When you see the message “Download complete!”, save all your work and close running applications. Type the final command to start the actual installation process:

sudo dnf system-upgrade reboot

The machine will restart into a minimal environment. You will see the Fedora logo with a progress bar on the screen. This process usually takes 20 to 45 minutes depending on your SSD speed and the number of software packages installed. Absolutely do not unplug the power or force shut down the machine during this time.

Post-Upgrade Verification and Optimization

Once you reach the new Desktop screen, open the Terminal and confirm the version:

cat /etc/fedora-release

Cleaning Up Remnants

After an upgrade, the system often leaves behind old (obsolete) packages that take up disk space. Run the following cleanup commands:

# Remove packages that are no longer supported
sudo dnf autoremove

# Rebuild the RPM database to avoid indexing errors
sudo rpm --rebuilddb

# Clean up the download cache
sudo dnf clean all

Checking Error Logs

If the machine boots slowly or Nginx/Docker services aren’t running, check the system logs immediately:

journalctl -p 3 -xb

This command only lists critical errors (Priority 3). Usually, you just need to update the syntax in the configuration files of your services to match the standards of the new version.

Upgrading Fedora via DNF is actually very straightforward if you master the process. I hope this experience helps you feel more confident when upgrading your workstation. If you encounter any strange errors during the upgrade, feel free to leave a comment below!

Share: