Fedora, a leading Linux distribution known for its cutting-edge features and stability, has recently released its latest version, Fedora 40. If you're currently running Fedora 39 and are eager to explore the new features of Fedora 40, this guide will walk you through the steps to upgrade from Fedora 39 to Fedora 40 for both Fedora Workstation and Fedora Server.
Before we begin the upgrade process for Fedora 40, let's explore the new features of Fedora 40.
Table of Contents
Fedora 40 Highlights
Fedora Workstation 40 introduces several exciting updates and enhancements:
- GNOME 46: This version features the latest GNOME desktop environment, GNOME 46, which includes upgrades to the Files app with new features and improved accessibility. Core apps have also been refined for better usability.
- Settings App Enhancements: The Settings app in GNOME 46 has been significantly updated, offering more keyboard shortcuts for easier navigation, a modern interface, faster loading of appearance settings, and improved Wacom stylus pressure control. It now includes a system panel that groups settings related to Region & Language, Date & Time, Remote Desktop, and About for simpler navigation.
- Touchpad Improvements: GNOME 46 introduces updated touchpad settings with two new options, including Secondary Click, which allows users to choose between two-finger or corner-click actions.
- KDE Plasma 6.0: Fedora 40 also offers the new KDE Plasma 6.0 desktop environment alongside GNOME 46, providing users with an alternative desktop experience.
- Linux Kernel 6.8: Powered by the Linux 6.8 kernel, Fedora 40 brings performance improvements and new features.
- Software Package Updates: Fedora 40 includes updates to various software packages, such as LLVM 18.
- Tools for AI development: Fedora Linux 40 now includes PyTorch package. PyTorch, a widely used framework for deep learning.
For more details, check the Fedora 40 release notes.
Prerequisites
Before you begin the upgrade process, ensure you have the following prerequisites in place:
- Backup Your Data: It's crucial to back up your important data to prevent any potential data loss during the upgrade. You can explore our Backup Tools category for some good applications to back up your data.
- Stable Internet Connection: Make sure you have a stable internet connection, as the upgrade process involves downloading packages from Fedora's repositories.
- Uninterrupted Power Supply: Sudden power outages or disruptions during an upgrade can potentially lead to data corruption or system instability. To ensure a smooth and safe upgrade, it's a good practice to have a UPS or ensure that you have a stable power source to prevent any interruptions.
- Check Fedora 40 common issues: See the Fedora 40 common issues and decide if you want to proceed.
- Patience: Upgrading your system may take some time, depending on your internet speed and system performance.
Fedora Upgrade Limitation
Upgrades in Fedora follow a specific pattern. Upgrades to the very next release (e.g., 39 to 40) as well as upgrades skipping one release (e.g., 38 to 40) are both officially supported.
However, upgrades across more than two releases are not officially supported. For example, you can't directly upgrade from Fedora 37 to 40. While it might work in some cases, it's not a recommended or supported method. If you encounter any issues during such upgrades, you won't receive official support.
To ensure a smooth upgrade experience, it's advisable to follow the supported upgrade path. In the example of upgrading from Fedora 37 to 40, the recommended approach is to first upgrade from Fedora 37 to the next release in the sequence (i.e., 37 to 38) and then proceed with the upgrade from 38 to 40.
Furthermore, it's always a good practice to upgrade your Fedora installation before it reaches its End of Life (EOL) to ensure you receive timely updates, security patches, and support from the Fedora community.
That's enough for now. Without waiting any longer, let's get started with upgrading to Fedora 40.
Update Fedora 39
Ensure that your Fedora 39 installation is up to date. You can do this by running the following commands in your terminal:
$ sudo dnf --refresh update
$ sudo dnf upgrade
Reboot your system to apply the updates:
$ sudo reboot
Let us check the current version using the following command:
$ cat /etc/fedora-release
To view the detailed version output, run this command instead:
$ cat /etc/os-release
Upgrade Fedora 39 Workstation to Fedora 40 Workstation via GNOME Software
You can perform the upgrade from Fedora 39 to Fedora 40 using the GNOME Software application, which provides a user-friendly graphical interface for system management.
Step 1 - Open GNOME Software:
Click on the "Activities" menu in the top left corner of your Fedora 39 desktop, type "Software" in the search bar, and click on the "Software" application icon to open it.
Step 2 - Go to Updates Section:
In GNOME Software, click on the "Updates" tab. You should see an option to "Fedora Linux 40 Available". Click on the Download button to start the download process.
GNOME Software will download the necessary files for the Fedora 40 upgrade. This process may take some time, depending on your internet connection speed.
Step 3 - Restart and Upgrade:
Once the download is complete, you'll be prompted to restart your Fedora system. Click "Restart & Upgrade" button.
Enter your sudo password to trigger the offline updates:
Click "Restart & Upgrade" to continue.
Your system will reboot now.
Once your Computer reboots, the actual upgrade will commence now. Be patient. It will take a few minutes to complete.
After the upgrade is installed, your system will reboot once again.
Step 4 - Log in to Fedora 40
Once your computer reboots, log in to your Fedora 40 desktop.
Congratulations! You've successfully upgraded your Fedora 39 system to Fedora 40 using GNOME Software.
You can verify the new Fedora version by opening a terminal and running:
$ cat /etc/fedora-release
Or,
$ cat /etc/os-release
You can also check the Fedora version under Settings -> System -> About section.
Now that you've successfully upgraded your Fedora 39 installation to Fedora 40.
Enjoy exploring the new features and improvements in Fedora 40!
Upgrade to Fedora 40 Server from Fedora 39 Server
Step 1 - Update Fedora Server:
Log in to your Fedora Server and open a terminal session. Update your Server using commands:
$ sudo dnf --refresh update
$ sudo dnf upgrade
Reboot your system to apply the updates.
$ sudo reboot
Step 2 - Install DNF Plugin:
Install the DNF system upgrade plugin if it's not already installed:
$ sudo dnf install dnf-plugin-system-upgrade
Step 3 - Start the Upgrade:
Begin the upgrade process by running the following command:
$ sudo dnf system-upgrade download --releasever=40
This command will download the required packages for the upgrade. This task should take several minutes to complete as it downloads a lot of packages.
If some of your packages have unsatisfied dependencies, the upgrade will refuse to continue until you run it again with an extra --allowerasing
option.
$ sudo dnf system-upgrade download --releasever=40 --allowerasing
Step - 4 Reboot and Upgrade:
After the download is complete, reboot your server to start the upgrade process:
$ sudo dnf system-upgrade reboot
Step 5 - Upgrade Progress:
Your server will reboot and execute the upgrade. Follow the on-screen instructions, and the process will complete automatically.
Step 6 - Verify the Upgrade:
Once the upgrade is finished, log in to your Fedora 39 Server. Confirm the new Fedora version by running:
$ cat /etc/fedora-release
You've successfully upgraded your Fedora Server to Fedora 40.
Fedora Post-upgrade Tasks
In this section, we will perform a few post-upgrade tasks, such as changing the hostname, removing unwanted packages, updating configuration files, deleting orphaned symlinks, and cleaning up old kernels, etc.
The steps provided below are applicable for both Fedora desktop and server editions.
1. Change Hostname
I usually use the distribution's name as the hostname. For example, the hostname for my Fedora 40 desktop would be fedora40. If you're anything like me, change the hostname to match your current version.
To change hostname, run:
$ sudo hostnamectl set-hostname fedora40
2. Clean DNF Metadata Cache
After upgrade, the cached metadata and transaction can cleared using the following commands:
$ sudo dnf system-upgrade clean
$ sudo dnf clean packages
3. Remove Old Packages
List all packages with broken or unsatisfied dependencies, run:
$ sudo dnf update
$ sudo dnf repoquery --unsatisfied
List all duplicate packages using command:
$ sudo dnf repoquery --duplicates
List all packages that are not in the repositories:
$ sudo dnf list extras
If you don't need them anymore, simply run the following commands to remove old, and unused packages.
$ sudo dnf remove $(sudo dnf repoquery --extras --exclude=kernel,kernel-*)
$ sudo dnf autoremove
4. Clean Up Retired Packages
A few packages will be retired in each Fedora release. They could be obsolete or the maintainer abandoned the packages. The retired packages packages will not get any updates, not even security updates.
To remove obsolete and retired packages, run:
$ sudo dnf install remove-retired-packages
$ remove-retired-packages
5. Update System Configuration Files
To update system configuration files, use rpmconf
tool.
To install rpmconf
tool, run:
$ sudo dnf install rpmconf
Once the install is complete, run the following command:
$ sudo rpmconf -a
6. Clean Up Old Kernels
The dnf autoremove
command will not remove any unused kernels to avoid unintentional Kernel removals. If you want to remove old kernels, run the following command:
$ sudo dnf remove $(dnf repoquery --installonly --latest-limit=-3)
The above command will remove all old kernels and retain only the latest 3 kernels.
Heads Up: It is HIGHLY RECOMMENDED to keep at least two kernels. Because, if there is a problem in the current Kernel version after upgrading, you can safely switch to the older kernel.
7. Remove Broken Symlinks
After system upgrade, there would be some unused symlinks left in your system. You need to find and delete the dangling soft links or symlinks that don't point anywhere.
To find broken symlinks in /usr
directory, run:
$ sudo symlinks -r /usr | grep dangling
To remove the dangling symlinks, run:
$ sudo symlinks -r -d /usr
Finally, reboot your system:
$ sudo reboot
Conclusion
In this guide, we have seen how to upgrade to Fedora 40 from Fedora 39 via Gnome Software center and from command line. At the end, we included a few post-upgrade steps that needs to be done to cleanup the newly upgraded fedora system.
Upgrading your Fedora system to the latest version allows you to enjoy the latest features, security enhancements, and improvements.
Make sure to regularly update your system to stay up-to-date with the Fedora community's developments. If you encounter any issues during the upgrade process, please leave a comment below or refer to Fedora's official documentation.