AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,100 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example" published by Apress, and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Upgrading Fedora Linux Using DNF System Plugin

By Luca Berton · Published 2024-01-01 · Category: installation

Learn how to seamlessly upgrade your Fedora system using the DNF System Plugin, ensuring you stay updated with the latest features, improvements, and security patches.

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:

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:

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:

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:

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

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:

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:

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

Clean-Up Retired Packages -------------------------

Remove retired packages with:

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

Clean-Up Old Packages and Kernels ---------------------------------

Identify and remove packages with broken dependencies:

Remove old kernels using the provided script.

Clean-Up Old Symlinks ---------------------

Install the symlinks utility and clean up broken symlinks:

Resolving Post-Upgrade Issues -----------------------------

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

Rebuilding the RPM Database ---------------------------

Rebuild the RPM database if warnings occur:

Using Distro-Sync to Resolve Dependency Issues ----------------------------------------------

Run distro-sync to address package dependency problems:

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

Relabel Files with the Latest SELinux Policy --------------------------------------------

Correct SELinux permission labels:

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.

Related ArticlesAnsible hostname Module: Set System Hostname on Linux (Guide)How to Run Linux Fedora Workstation 39 on an Apple MacHow to install Ansible in Fedora 34 - Ansible install

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home