Upgrading from Fedora Linux 39 to Fedora Linux 40.

Advertisement

The update to Fedora 40 It's now available, and you're probably excited to update immediately. Well, here are the update methods and some recommendations.

1- Update to the next version of Fedora Workstation by gnome software.

In Fedora Workstation When the next stable release is available, a graphical notification similar to the update notifications will appear. Clicking this, or running the software application and accessing the Updates panel, will display a simple graphical interface for updating your system.

Important: Before you begin the upgrade, your system must be fully updated to ensure a smooth system upgrade.

First, click on the button Update at the top left to make sure your software has the latest updates. If unapplied updates are displayed, click the button Discharge next to them (and then on the button Reboot and update , when it appears) to fully update your existing system. This is really important—don't skip this step. Once done, you can click Download in the "Fedora Linux Available" section to begin updating your system to the new version.

2- Upgrade from Fedora 39 to Fedora 40 using the DNF system plugin.

dnf-plugin-system-upgrade is a plugin for the package manager DNF and is used to update your system to the current version of Fedora.

This is the recommended command-line upgrade method. It works as follows:

Packages are downloaded while the system is running normally.

The system reboots into a special environment (implemented as a target) systemd) to install them.

Upon completion, the system reboots into the new version of Fedora.

Make sure your system is fully updated before attempting to upgrade to a new version of Fedora Linux.

Be sure to back up your data before upgrading your Fedora Linux system in case something breaks and renders your system unusable.

This is extremely unlikely, but it's better to be safe than sorry. In any case, it's a good idea to back up important data regularly, and now is a good time to double-check.

To upgrade your version of Fedora from the command line, do:

$ sudo dnf upgrade --refresh

and restart your computer.

Important: Don't skip this step. System updates are required to receive signing keys for higher versions and often resolve issues related to the update process.

Install the package dnf-plugin-system-upgrade if not currently installed:

$ sudo dnf install dnf-plugin-system-upgrade

Download the updated packages:

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

Change the –releasever=número If you want to upgrade to a different version. Most people will want to upgrade to the latest stable version, which is 40, but in some cases, such as if you're currently running a version older than 39, you may want to upgrade only to Fedora 40. Upgrading your system is only officially supported and tested at most two versions (e.g., from 38 to 40).

If some of your packages have unmet dependencies, the upgrade will refuse to continue until you run it again with an additional option –allowerasing This often happens with packages installed from third-party repositories for which an updated repository has not yet been released. Study the output very carefully and examine which packages are being removed. None of them should be essential for system functionality, but some may be important for your productivity.

In case of unmet dependencies, you can sometimes see more details if you add the option –best to the command line.

If you want to remove/install some packages manually before running them dnf system-upgrade download Again, it is advisable to perform these operations with –setopt=keepcache=1 in the command line option dnfOtherwise, the entire package cache will be deleted after the operation and you will have to download all packages again.

When the new key is imported GPG, you are prompted to verify the key fingerprint. See https://getfedora.org/security to do it.

Check your download

Once you've downloaded an image, be sure to check its security and integrity.

By calculating the image checksum on your own computer and comparing it to the original checksum, you can verify that the image has not been tampered with or corrupted. Images are also signed with gpg with Fedora keys to prove its integrity.

Check with CHECKSUM files

Download the file checksum in the same directory as the image you downloaded in https://download.fedoraproject.org/pub/fedora/linux/releases/40/Workstation/x86_64/iso/Fedora-Workstation-40-1.14-x86_64-CHECKSUM

Create the file Fedora-Workstation-40-1.14-x86_64-CHECKSUM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

# Fedora-Workstation-Live-osb-40-1.14.x86_64.iso: 2623733760 bytes
SHA256 (Fedora-Workstation-Live-osb-40-1.14.x86_64.iso) = 8d3cb4d99f27eb932064915bc9ad34a7529d5d073a390896152a8a899518573f
# Fedora-Workstation-Live-x86_64-40-1.14.iso: 2295853056 bytes
SHA256 (Fedora-Workstation-Live-x86_64-40-1.14.iso) = dd1faca950d1a8c3d169adf2df4c3644ebb62f8aac04c401f2393e521395d613
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEEV35rvhXhT7oRF0KBydwfqFbecwFAmYisFcACgkQBydwfqFb
ecxHAhAAuyBb34jmvnR7GTfHfkUjh2s+oyn47Ytj7mhhNSwvg63utYdYbqQs2htS
oplomvcO0lt0vBeHjXGLUL4PeGhPWO/4As9hM7QjdqdRGUiZLYdVv44qzmApesWm
QU+tl9b76cf/QzUOcGSlGrhYWKZ+sZ/Ke9G81WQOlThcwUcVHVDwwJtsHShpsa8e
0WefRZiR3+qRxLxuzBtN7K7lXTBXzAqF4rTPZeBHSQ6oiLnKc8dARMxucov20MQx
MDQfmXXz7zNWilKjucurEuQxYGUkzl08kAHEZbeF4sgkaEqnWerovj7hdgyhW4Fx
Riw7t7B2Y2rMpJmRsH9loGATmB2g+4TyLDcOr8uQvLMTj3ytUw1GD+yPsxv4z2ik
Lx9MPllA+GGaMMUKfUThHLlZMvBOXYymbOlKZVHX/78I+G6t5efmn77v6R2SwgW3
V43/QNJld3+J6V68sk3g3KFpGbrvPoEzYYMXOTzy5gHGB3ppuvdDldgzFKwi2Dsy
LIlORoGpBsLSi6SUGPXw3i/UG04lnna3nX5I0sZMWV2kVbTziI9vit8nichcAXQs
qG2yuINwFxVxC7Gf76n0OIjy5dyapaJfCHWerGFy5cFQbuAv5JvfvBocLm3a58hh
Xfc5x/jQjnRPYBg9o2dA1kEwmoA76yR9apSoqNQtACdnVMMhzrA=
=HgqN
-----END PGP SIGNATURE-----

If your download comes with a file CHECKSUM, follow these simple steps to verify your image for both security and integrity.

Import GPG key(s) from Fedora

$ curl -O https://fedoraproject.org/fedora.gpg

List Fedora GPG keys

$ gpg --with-fingerprint --show-keys --keyid-format long fedora.gpg

You can check the details of the GPG keys below.

Verify that the CHECKSUM file is valid

$ gpgv --keyring ./fedora.gpg *-CHECKSUM

Verify checksum matches

$ sha256sum -c *-CHECKSUM

If the result indicates that the file is valid, then it's ready to use!

Advertisement

Click the Check button for personalized download instructions.

Trigger the update process. This will reboot your machine (immediately!, no countdown or confirmation, so close other programs and save your work) into the update process running in a console terminal:

$ sudo dnf system-upgrade reboot

Once the upgrade process is complete, your system will reboot for the second time into the updated version of Fedora.

Optional post-upgrade tasks.

Update system configuration files
Most configuration files are stored in the folder /etc . If you have changed the package configuration files, RPM creates new files with .rpmnew (the new default configuration file) or .rpmsave (your old backed up configuration file). You can search for these files or use the tool rpmconf which simplifies this process. To install rpmconf, enter:

$ sudo dnf install rpmconf

Once the installation is complete, enter:

$ sudo rpmconf -a

Update the GRUB bootloader on BIOS systems
Systems with BIOS firmware they have the packages GRUB RPM updated. However, the installed or built-in bootloader is never automatically updated. It's a good idea to update it between Fedora releases.

Find the device node that the directory is located on /boot/:

$ sudo mount | grep "/boot "

The device node is /dev/sda4. Reinstall the bootloader while specifying the device node without the number:

$ sudo grub2-install /dev/sda

Clean-up retired packages
With each release, Fedora retires some packages. There are several reasons: the packages become obsolete, they have a dead upstream, or the maintainer retires. Fedora no longer distributes these packages; however, they are still on your system. These packages will not receive updates. It is highly recommended to remove them.

If you are upgrading a version (for example, Fedora 39 to 40), run the following commands:

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

Clean-up old packages
You can see a list of packages with broken dependencies by typing:

$ sudo dnf repoquery --unsatisfied

The list should be empty, but if not, consider deleting them, as they likely won't work.

You can see duplicate packages (packages with multiple versions installed) with:

$ sudo dnf repoquery --duplicates

And you can remove them with:

$ sudo dnf remove --duplicates

For packages from the official repositories, the latest version should be installed. However, some packages that are still on your system may no longer be in the repositories. To view a list of these packages, do the following:

$ sudo dnf list extras

If you see a package you don't need or use, you can remove it with:

$ sudo dnf remove $(sudo dnf repoquery --extras --exclude=kernel,kernel-*)

You can safely remove packages that are no longer used with:

$ sudo dnf autoremove

DNF You decide a package is no longer needed if you haven't explicitly requested it be installed and nothing else requires it. However, that doesn't mean the package isn't useful or that you won't use it. Only remove what you're sure you don't need.

Clean-up old kernels

One of the easiest ways to remove old kernels is with a script that keeps the latest kernel. The following script works whenever Fedora updates a kernel and is not dependent on a system update.

#!/usr/bin/env bash

old_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))
if [ "${#old_kernels[@]}" -eq 0 ]; then
    echo "No se encontraron kernels antiguos"
    exit 0
fi

if ! dnf remove "${old_kernels[@]}"; then
    echo "No se pudo eliminar el viejo kernel"
    exit 1
fi

echo "Eliminado viejo kernels"
exit 0

Clean-up old symlinks
There may be some symbolic links pending in the file system after an upgrade. You can clean up pending links by installing the symbolic link utility and deleting the old links.

$ sudo dnf install symlinks

Once the utility is installed, you can perform an audit to detect broken symbolic links, as shown below. -r means recursive.

$ sudo symlinks -r /usr | grep dangling

After checking the list of broken symbolic links, you can delete them as shown below. -d means to delete.

$ sudo symlinks -r -d /usr

Update the rescue kernel
Anaconda generates the rescue kernel and initramfs during system installation. The initramfs will be updated when the kernel is updated, but the rescue kernel may not. The rescue kernel update depends on the system configuration.

If the rescue kernel is not up to date, issue the following commands to regenerate it.

$ sudo rm /boot/rescue
$ sudo kernel-install add "$(uname -r)" "/lib/modules/$(uname -r)/vmlinuz"

The rescue kernel rebuild process can be automated by installing the package dracut-config-rescue .

$ sudo dnf install dracut-config-rescue

Once installed, the rescue kernel will be regenerated whenever dracut be the generator of initrd. See /usr/lib/kernel/install.d/51-dracut-rescue.install.

Post-upgrade troubleshooting.

Follow these steps only if you are experiencing problems with your updated system.

RPM Database Rebuild
If you see warnings when working with tools RPM/DNFYour database may be corrupted. You can rebuild it to see if it resolves your issues. Always roll back first. /var/lib/rpm/ To rebuild the database, run:

$ sudo rpm --rebuilddb

Using distro-sync to resolve dependency issues
The system update tool is used dnf distro-sync by default. If your system is partially updated or you see some package dependency issues, try running another distribution sync manually to see if this fixes the problem. This will attempt to ensure that your installed packages are at the same version in your currently enabled repositories, even if you have to downgrade some packages:

$ sudo dnf distro-sync

You can also use the option –allowerasing to remove packages with dependencies that cannot be satisfied. Always check which packages will be removed before confirming this:

$ sudo dnf distro-sync --allowerasing

Relabel files with the latest SELinux policy
If you find any warnings about policies with SELinuxSome files may have incorrect SELinux permissions. This can happen if SELinux was disabled in the past. To re-enable SELinux on the system, run the following command and then reboot:

$ sudo fixfiles -B onboot

The boot process may take a long time as it checks and corrects SELinux permission labels on all files on your system.

Well, we have successfully finished upgrading from the old version of Fedora Linux 39 to the new and modern version of Fedora Linux 40. I hope this article helps the GNU/Linux community.

Our score
Click to rate this post!
(Votes: 0 Average: 0)
Advertisement

Share on social media...

Descubre más desde javiercachon.com

Subscribe to get the latest posts sent to your email.

Deja un comentario

Your email address will not be published. Required fields are marked *

Basic information on data protection
Responsible Javier Cachón Garrido +info...
Purpose Manage and moderate your comments. +info...
Legitimation Consent of the concerned party. +info...
Recipients Automattic Inc., USA to spam filtering. +info...
Rights Access, rectify and cancel data, as well as some other rights. +info...
Additional information You can read additional and detailed information on data protection on our page política de privacidad.

Scroll al inicio

Descubre más desde javiercachon.com

Suscríbete ahora para seguir leyendo y obtener acceso al archivo completo.

Seguir leyendo

Hello!

Click on one of our representatives below to chat via Telegram or send us an email to soporte@javiercachon.com

Aid!