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?

    Thanks,
    Thuan

  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:

    Hint:
    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)

    —–BEGIN PGP PUBLIC KEY BLOCK—–
    Version: GnuPG v1

    mQINBFWzypoBEADEiE8DQT5k/RPTTsmGKFZ6A0gMH0CH+BY0CLWCMFgS3UnXvUkW
    LJb0y7v/4cdA4ir0CwQIeQmCOD5uwUtgy/nMUUiXqEiKslbvqz+a+fn1S4P3RPEE
    FtG/rrujaY6Y4dSdJfmczHr2X8UUjN+uNwHvWMkE2PKmYUJ9B3ezYSGEBDr+fmxr
    WE923E4wBu3W0EBcwr8R/YuRMW2atBtq2YJoGWEM5Ev7H5RGR4Ah9R1YG+pfn1m0
    TfFfvAqNQCKGjeIfM6gVJWdcay4qyzla6cpTZWxa86OaWNFXeRrUXRSPTJVMUp2D
    29CHjJwMeBqTKGDKmbISzLPprCCNvvg2S9fwZrYXWekB2ktvce2Q248XEdpjbT9H
    FXFA4Fmbzs0x/OuhII6qnpgbbJJHqcigkK7emJ5v9Fsc9k3wrhSt+wO68IKuCtUx
    bfFiFAS9UcLztaFGE1aswojGfncBP8Xq6+VeMd1RSKcRJsWlyvSVQJ+TuHV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—–END PGP PUBLIC KEY BLOCK—–

    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

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s