Ansible Pilot

Upgrading Fedora Linux Using DNF System Plugin

A Step-by-Step Guide to Fedora Upgrade with DNF System Plugin.

November 21, 2023
Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons

Introduction

The Fedora Linux operating system is known for its frequent releases, bringing the latest features, improvements, and security updates to users. Upgrading your Fedora system is a crucial process to ensure you are benefiting from the latest advancements. In this guide, we’ll explore the DNF system plugin, a powerful tool for upgrading your Fedora system seamlessly.

Understanding DNF System Plugin

The dnf-plugin-system-upgrade is an essential component of the DNF package manager designed specifically for upgrading Fedora systems. It offers a reliable and efficient command-line method for transitioning your system to the most recent Fedora release. It’s important to note that if you’re using Fedora Silverblue or Fedora CoreOS, which utilize rpm-ostree, you should refer to the rpm-ostree documentation for upgrade instructions.

Preparing for the Upgrade

Before initiating the system-wide upgrade, it’s crucial to back up your data. While the upgrade process is generally smooth, unexpected issues can arise, making data backup a necessary precaution. Downloading the Fedora Workstation Live image provides an additional safety net in case something goes wrong during the upgrade.

To ensure a successful upgrade, it’s recommended to perform routine system updates using the following command:

$ sudo dnf upgrade --refresh

This step is essential for receiving signing keys of higher-versioned releases and addressing potential issues related to the upgrade process.

Installing the DNF System Upgrade Plugin

If you don’t have the dnf-plugin-system-upgrade package installed, use the following command:

$ sudo dnf install dnf-plugin-system-upgrade

This plugin facilitates the download and installation of updated packages during the upgrade process.

Downloading Updated Packages

To download the updated packages for the desired release, execute the following command:

$ sudo dnf system-upgrade download --releasever=39

Adjust the release version as needed. Most users will upgrade to the latest stable release (e.g., 39). It’s important to note that official support and testing cover upgrades across a maximum of two releases.

Managing Dependencies

If any packages have unsatisfied dependencies, the upgrade process will prompt you to address this issue. Adding the --allowerasing option might be necessary in cases where packages from third-party repositories lack updated versions. Carefully review the output and consider using the --best and --setopt=keepcache=1 options for additional details and control.

Triggering the Upgrade

Once the packages are downloaded, trigger the upgrade process with:

$ sudo dnf system-upgrade reboot

Be prepared for an immediate reboot into the upgrade process. Save your work and close other programs before executing this command.

The Best Resources For Ansible

Certifications

Video Course

Printed Book

eBooks

Post-Upgrade Tasks

After the upgrade is completed, consider performing the following tasks:

Update System Configuration Files

Use the rpmconf tool to manage configuration files:

sudo dnf install rpmconf\
sudo rpmconf -a

Review and verify changes in configuration files, especially those in /etc/yum.repos.d/ for third-party packages.

Update GRUB Bootloader on BIOS Systems

Update the GRUB bootloader for systems with BIOS firmware:

$ sudo grub2-install /dev/sda

Replace /dev/sda with the appropriate device node obtained from the sudo mount | grep "/boot " command.

Clean-Up Retired Packages

Remove retired packages with:

sudo dnf install remove-retired-packages\
remove-retired-packages

For upgrades across two releases, specify the old release version:

$ sudo dnf install remove-retired-packages\
remove-retired-packages 38

Clean-Up Old Packages and Kernels

Identify and remove packages with broken dependencies:

$ sudo dnf repoquery --unsatisfied\
$ sudo dnf repoquery --duplicates\
$ sudo dnf remove --duplicates\
$ sudo dnf autoremove

Remove old kernels using the provided script.

Install the symlinks utility and clean up broken symlinks:

$ sudo dnf install symlinks\
$ sudo symlinks -r -d /usr

Resolving Post-Upgrade Issues

If issues arise post-upgrade, consider the following steps:

Rebuilding the RPM Database

Rebuild the RPM database if warnings occur:

$ sudo rpm --rebuilddb

Using Distro-Sync to Resolve Dependency Issues

Run distro-sync to address package dependency problems:

$ sudo dnf distro-sync

For more aggressive dependency resolution, use the --allowerasing option:

$ sudo dnf distro-sync --allowerasing

Relabel Files with the Latest SELinux Policy

Correct SELinux permission labels:

$ sudo fixfiles -B onboot

Reboot the system after relabeling.

Frequently Asked Questions

How to Report Upgrade Issues?

Refer to common bugs, search Bugzilla, and follow bug reporting instructions in the GitHub repo or man dnf.plugin.system-upgrade. File specific package issues if needed.

Does DNF System Upgrade Verify Software?

Yes, DNF verifies the integrity of downloaded packages using signing keys for the newer Fedora release. Disabling this function is not recommended.

Will Third-Party Repositories Be Upgraded?

Yes, if configured as regular DNF repositories. Update repository paths if needed, especially around official Fedora releases.

Can I Upgrade from an End-of-Life Release?

Upgrading from an End-of-Life release is not recommended for production systems or those connected to the internet. Consider upgrading to a currently supported release through intermediate steps.

Can I Upgrade Across Many Releases?

Upgrades to the next release and skipping one release are supported. Upgrades across more than two releases are not supported, and issues may not be considered significant bugs.

Can I Upgrade to a Pre-Release?

Upgrading to a pre-release (e.g., Beta) is possible but may experience temporary breakage due to the nature of pre-releases.

Conclusion

Upgrading your Fedora system using the DNF system plugin ensures you stay current with the latest features and security updates. By following this comprehensive guide, you can navigate the upgrade process smoothly, address potential issues, and make the most of the latest Fedora release. Remember to back up your data, review configuration changes, and stay informed about post-upgrade tasks for a successful and trouble-free transition.

Subscribe to the YouTube channel, Medium, and Website, X (formerly Twitter) to not miss the next episode of the Ansible Pilot.

Academy

Learn the Ansible automation technology with some real-life examples in my

My book Ansible By Examples: 200+ Automation Examples For Linux and Windows System Administrator and DevOps

BUY the Complete PDF BOOK to easily Copy and Paste the 250+ Ansible code

Want to keep this project going? Please donate

Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons
Follow me

Subscribe not to miss any new releases