August 3, 2023

Fedora -- how to upgrade a Fedora system

This is how I do things. These methods have worked well for me over many years.

New Fedora releases come out once or twice a year. The intent is that a new release will be released twice a year, but it doesn't seem to me that they come out that often.

It is important to not get too far behind. Fedora provides support for two releases behind the current release. At the time of this writing the current release is Fedora 38. So 36 and 37 are still getting support. If you were lazy and kept running 36 until 39 came out (due in October of 2023) you might have trouble upgrading from 36.

Also I never "jump" a release. In other words if I am running 36 and 38 is current I won't try a direct upgrade to 38. I will upgrade to 37 and then immediately upgrade to 38. I will also scold myself for not having done the 37 upgrade sooner.

I use the DNF package method to do my upgrades.

What am I currently running?

Type the command "uname -a" and you will get something like this:
Linux trona.mmto.org 6.4.6-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 24 20:51:12 UTC 2023 x86_64 GNU/Linux
The important thing in the above is the "fc38" which indicates I am running Fedora 38.

This command also shows what kernel I am running -- here it is "6.4.6-200.fc38.x86_64". Before I do an upgrade I make sure I am running the latest available kernel. You can find out what kernels are available by the command "ls /boot".
I get this on my system (along with other chatter not shown here):

vmlinuz-6.4.4-200.fc38.x86_64
vmlinuz-6.4.6-200.fc38.x86_64
vmlinuz-6.4.7-200.fc38.x86_64
As you can see, a 6.4.7 kernel is available and I am running 6.4.6. I should reboot to run the 6.4.7 kernel before doing the upgrade.

As a side note. I configure my systems to do automatic updates, pulling in new packages daily. But I do not reboot to new kernels, so new kernels may arrive but not be running.

Actually doing the upgrade

You will need the super user password. Where I show the "su" command below, you will need to enter (and will be prompted for) the super user password.
First reboot to the latest kernel if necessary:
su
reboot

Next, ensure that all packages are up to date before beginning the actual upgrade. Usually these go quickly and do nothing.

su
dnf update
dnf upgrade --refresh
Next download all packages for the upgrade. This will take a while, perhaps 30 minutes. Be sure to replace the "38" with whatever version you are upgrading to:
dnf -y system-upgrade download --refresh --releasever=38
Once the above has completed successfully, you should not have trouble with the actual upgrade, which you launch as follows:
dnf system-upgrade reboot
This may take as much as an hour and will reboot the system into a special mode for the duration of the install. Be patient. When it is done, it will reboot again to run the new system and you can login. Type "uname -a" to verify that you are now running the new system and you are back to business.

You can type escape to see actual system messages in lieu of the cute graphical progress screen while this is all taking place if that makes you happy.

Possible problems

Sometimes the download step encounters problems with unavailable packages to some inscrutable issue. It is hard to give definite advice about what to do. Usually the problem is resolved by deleting some package then repeating the download step, sort of like this:
dnf erase weird-package
dnf -y system-upgrade download --refresh --releasever=38

Problems with cfitsio

I am listing this here as an example of a problem that may arise after an update has been cleanly finished.

After the update to f38, the "ovend" program would not run and gave the error:

ovend: error while loading shared libraries: libcfitsio.so.9: cannot open shared object file: No such file or directory
I have seen a message like this before, and as I remember the name of the library it reports is wrong and misleading. Maybe not, as I see the version number for the library has bumped from 9 to 10:
/usr/lib64/libcfitsio.so.10
The fix is simple, quick and easy -- rebuild ovend from source, which can be done as follows:
login as tom
cd newoven
make clean
make
make install
You can "become tom" by using su to become superuser, then "su - tom" to become tom.
Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org