Fedora Upgrade from 21 to 24

After almost 5 hours of upgrading, my server has been successfully upgraded from Fedora 21 to Fedora 24, which uses the latest stable kernel 4.6. There is a online post demonstrating how to upgrade from Fedora 21 to 23 using fedup. This post talks about Fedora upgrading from 21 to 24 using dnf. NOTE: please do backup your data before action!

0. yum update

This is usually not a problem for Fedora 21, whose support has expired for a long time. Anyway, run it just in case.

1. dnf

According to the Fedora official wiki (https://fedoraproject.org/wiki/DNF_system_upgrade), dnf is recommed for system upgrade. Apparently, fedup has been ditched. Here what we need are 3 dnf commands:

sudo dnf upgrade --refresh
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --refresh --releasever=24

The last dnf command should list any error, which blocks the upgrade. The errors I have encountered were obsolete packages which are not supported in Fedora 24 repo. As you can tell, the only way to move the upgrade is to remove all these obsolete packages, using “yum remove” + unsupported package name reported by dnf.

Once all the errors are cleaned, dnf is able to download all the required packages for Fedora 24. On my server, it was about 4GB. So, you need at least some GB left to hold all these new packages. More important, dnf requires another 5GB under root during the package installation. Make sure you make dnf happy.

2. Keys

Before dnf was able to install all new downloaded packages, I got such an error:

Couldn’t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-x86_64

There is a bug report talking about the possibilities of this issue and corresponding fixes (https://bugzilla.redhat.com/show_bug.cgi?id=1044086#c11). However, if you find manual key importing does not work, go and take a look at /etc/pki/rpm-gpg directory. What happened to my server was simply no any key file for Fedora 24. Oops. The fix is also easy – creating the key files by ourselves. Go to https://getfedora.org/keys/ and find the key files (primary/secondary). Create these key files and symlink the x86_64 (arch of my server) with the primary. That’s it.

3. dnf again

Reboot the machine to start the upgrade:

sudo dnf system-upgrade reboot

Hint: yum is now deprecated. Run “dnf update” once you are into the new system.

About daveti

Interested in kernel hacking, compilers, machine learning and guitars.
This entry was posted in Linux Distro and tagged , , , . Bookmark the permalink.

4 Responses to Fedora Upgrade from 21 to 24

  1. Thuan says:

    Hi Dave,

    ” The fix is also easy – creating the key files by ourselves. Go to https://getfedora.org/keys/ and find the key files (primary/secondary). Create these key files and symlink the x86_64 (arch of my server) with the primary. That’s it.”

    Can you tell me more detail? How to do like you wrote?


  2. Dave Tian says:

    Go and take a look at /etc/pki/rpm-gpg directory. You will find the existing keys. Download Fedora 24 keys from the web site I posted above, e.g, here is the primary key file for Fedora 24 – https://getfedora.org/static/81B46521.txt. Save this key file in he rpm-gpg directly according to the same naming style. Create symlink named RPM-GPG-KEY-fedora-24-x86_64 pointing to the primary (if I recall).

  3. Fritz Elfert says:

    No need to remove unsupported packages manually. Simply add the –allowerasing option when downloading and it will automatically remove packages with broken dependencies.

  4. Nikola says:

    Hello all,

    I am new in fedora and this what I did but is still did not work.
    create file 81B46521.txt and copy information from https://getfedora.org/static/81B46521.txt.
    then make simbolic link as you suggested.

    what was done
    [root@home rpm-gpg]# cat 81B46521.txt
    pub 4096R/81B46521 2015-07-25 Fedora (24)

    Version: GnuPG v1


    Create sibolic link
    [root@home rpm-gpg]#
    -rw-r–r– 1 root root 1740 Nov 21 14:43 81B46521.txt
    lrwxrwxrwx 1 root root 44 Nov 21 14:44 RPM-GPG-KEY-fedora-24-x86_64 -> RPM-GPG-KEY-rpmfusion-free-fedora-24-primary
    [root@home rpm-gpg]#

    Error message

    SKIPPED] youtube-dl-2016.10.25-1.fc24.noarch.rpm: Already downloaded
    warning: /var/lib/dnf/system-upgrade/adobe-source-han-sans-tw-fonts-1.004-3.fc24.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 81b46521: NOKEY
    GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-x86_64 (0xB7546F06) is already installed
    Error: The GPG keys listed for the “Fedora 24 – x86_64” repository are already installed but they are not correct for this package.
    Check that the correct key URLs are configured for this repository.

    Failing package is: adobe-source-han-sans-tw-fonts-1.004-3.fc24.noarch
    GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-24-x86_64

    Could you please help ?

Leave a Reply to Thuan Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.