Fedora - System Upgrade

Running Fedora comes with a new release every 6 months. Furthermore, you are having a somewhat short maintenance time of ~13 months, only. This means, that you need to upgrade your Fedora installation occasionally. Let's see how you can do this.

Fedora - System Upgrade
Photo by Mike van den Bos / Unsplash

Running Fedora comes with a new release every 6 months. Furthermore, you are having a somewhat short maintenance time of ~13 months, only. This means, that you need to upgrade your Fedora installation occasionally. Let's see how you can do this.

Upgrade

I strongly recommend doing system updates on a regular basis. Updating will make your system more secure and also fixes some nasty bugs. Upgrading to the next major version will also introduce new software, features and functionality.

Fedora supports upgrades from one major version to another. This avoids the demand of re-installations to get the newest features and software versions.

We are also having some cool use cases in our blog. We can upgrade the Fedora Home Server or a Workstation as described below.

Let's see how we can do this.

Preparation

As for any system upgrade, it is recommended to do a backup beforehand. In general, the process is rock solid, but there is still the chance that something may go entirely sideways. To avoid data loss, ensure that your data (/home for workstations and /var for servers) is backed up properly.

Furthermore, it is recommended to ensure that your device has proper power. So, charge your notebook or keep it plugged in, ensure that your home server will not be plugged out accidentally and avoid having pets around that cause trouble.

In addition, a system upgrade is a very nice opportunity for cleanup. Instead of updating every piece of software on your machine, I recommend reviewing what's installed. Do you still need the image editor you tested some weeks ago? Is this COPR repository still needed?

Now, it's a good idea to check if some of your 3rd party repositories need some special handling. If you have RPMFusion or COPR repositories enabled, please check if these are having packages for your new Fedora version. Occasionally, these need special treatment.

Lastly, do a regular update and reboot before proceeding. There may be some hung up processes, leftover package updates or stuck services in the background. This does not happen very often, but it does not hurt to reboot your machine beforehand.

Via GNOME Software

Fedora Workstation introduced system upgrades via GNOME Software some years ago. This makes it very easy to upgrade, even for beginners.

Just open GNOME Software and go to the usual Updates tab. If a new release is available, you will be greeted with a screen like shown below.

Screenshot - GNOME Software

The above screenshot is "stolen" from the fedora documentation. But, let me give a little explanation, too. If you opened GNOME Software and hit the refresh button (1), you may see an available system upgrade.

GNOME Software wants you to install pending software updates beforehand(2,3). You may need a reboot, before continuing. In case you skipped the above preparation step, ensure that you perform all pending updates and rebooted your machine.

Afterwards, just hit the Download button (4) to proceed. GNOME Software will download all the packages in the background and ask you to reboot. During the reboot, Fedora will apply the upgrades, which may take a while.

If everything goes well (in my case, it never failed), the machine will boot up with the new Fedora Version.

Via Command Line

Doing the system upgrade via command line is another viable option, if you are running a server (like our Fedora Home Server) or just don't like GNOME Software.

The procedure is pretty straight forward. Just enter the below commands, and you are good to do.

# Update the system, if you haven't done already
$ sudo dnf --refresh upgrade

# Reboot, if updates were available
$ sudo reboot

# Install Upgrade tools
$ sudo dnf install dnf-plugin-system-upgrade -y

# Apply the upgrade
$ sudo dnf system-upgrade download --releasever=VERSION

# For Fedora 36 this will look like
$ sudo dnf system-upgrade download --releasever=36

There is a chance, that the upgrade step will raise an error message like "conflicting dependencies" or "want to install xxx but xxx is in the way". In case you are facing these, the below commands will take care.

# Sync to current state
$ sudo dnf distro-sync

# Apply the upgrade and allow uninstallation
$ sudo dnf system-upgrade download --releasever=36 --allowerasing

In my case, some leftovers from old tests were removed with this procedure. After the successful download, you will see a message, that you need to reboot to apply the system upgrade.

# Reboot
$ sudo dnf system-upgrade reboot

Fedora will reboot and do the offline system upgrade afterwards. This may take a while. Time for a cup of tea or coffee. After some time, your system should come up with a fresh and updated system.

Post Upgrade

Now that the system is upgraded, I recommend doing some minor post upgrade steps. This will ensure that your system is fine and you will not be surprised.

Check RPM Configuration

Some packages are providing new configurations. This is normally not an issue. If you changed a configuration in the /etc directory, an upgrade may provide new configurations as .rpmnew file or store old configurations as .rpmsave file.

I recommend checking these and reviewing these changes. It is pretty easy to do this automatically.

# Install packages
$ sudo dnf install rpmconf

# Search for outdated config
$ sudo rpmconf -a

# Get help if needed
$ man rpmconf

Remove retired packages

Every release of Fedora retires some packages, that are no longer maintained, not part of a release or not even in the repositories. Removing these will ensure that your system works smoothly.

# Install packages
$ sudo dnf install remove-retired-packages

# Remove the retired packages
$ remove-retired-packages

Cleanup leftover packages

Lastly, you can check if some packages are no longer requested or have broken dependencies. There are three commands that will help with mitigating this situation.

# Check broken dependencies
$ sudo dnf repoquery --unsatisfied

# Check duplicate packages
$ sudo dnf repoquery --duplicates

# Automatically clean up packages
$ sudo dnf autoremove

I have written some articles about new features for Fedora Linux 36. Furthermore, Fedora provides some documentation for the same.

Release - Fedora Linux 36
On Tuesday 03.05.2022, Fedora Linux 36 will be released, and I really want to give a brief overview of what’s new and what changed. Since I haven’t done a GNOME 42 release article, I will cover some included changes here, too.
Upgrading to a new release of Fedora :: Fedora Docs

Conclusion

Upgrading a Fedora system is pretty easy and provides not only new features, but also security updates and bug fixes. It doesn't matter if your machine is a workstation or a server, Fedora provides a nice way to perform updates properly.

What about you? Have you done system upgrades in the past? What is your experience? I would love to hear about your upgrades.