Dnf retrieving packages from version 40 after upgrading to Fedora 41

Just upgraded my Fedora 40 to Fedora 41 following standard instructions ( Upgrading Fedora Linux Using DNF System Plugin). The upgrade went fine, except for some post-upgrade tasks:

  1. dnf distro-sync offered retrieving all old Fedora 40 packages for some reason, which I declined.

I proceeded with remaining post-upgrade tasks, and rebooted the system. uname and /etc/os-release reported v.41 as expected. However, dnf upgrade --refresh still uses version 40 repositories (?!).

  1. Also, remove-retired-packages reported some odd messages about libdnf plugins: local

What’s going on here, and how can this be fixed?

$ uname -a
Linux machine-name 6.11.5-300.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 22 20:11:15 UTC 2024 x86_64 GNU/Linux
$ dnf distro-sync
Updating and loading repositories:
 Fedora 40 - x86_64                                                                       100% |   4.2 MiB/s |  20.7 MiB |  00m05s
 Fedora 40 openh264 (From Cisco) - x86_64                                                 100% |   9.4 KiB/s |   6.0 KiB |  00m01s
 Fedora 40 - x86_64 - Updates                                                             100% |   4.3 MiB/s |  11.4 MiB |  00m03s
Repositories loaded.
Package                                               Arch     Version                                  Repository            Size
Upgrading:
 NetworkManager                                       x86_64   1:1.46.2-1.fc40                          updates            5.8 MiB
   replacing NetworkManager                           x86_64   1:1.46.0-2.fc40                          <unknown>          5.8 MiB
 NetworkManager-adsl                                  x86_64   1:1.46.2-1.fc40                          updates           40.0 KiB
   replacing NetworkManager-adsl                      x86_64   1:1.46.0-2.fc40                          <unknown>         40.0 KiB
...
$ remove-retired-packages
Looking for retired packages between Fedora Linux 40 and Fedora Linux 41
Retired packages are no longer maintained. Answer N to the following questions to keep them,
but these packages will not get any updates. Not even security updates.
Gathering package list for Fedora Linux 40
No matches were found for the following plugin name patterns while disabling libdnf plugins: local
No matches were found for the following plugin name patterns while disabling libdnf plugins: local
Gathering package list for Fedora Linux 41
No matches were found for the following plugin name patterns while disabling libdnf plugins: local
No matches were found for the following plugin name patterns while disabling libdnf plugins: local
Asking for super user access:
These packages have been retired:
$ cat fedora.repo
[fedora]
name=Fedora $releasever - $basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
countme=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
$ cat fedora-updates.repo
[updates]
name=Fedora $releasever - $basearch - Updates
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
enabled=1
countme=1
repo_gpgcheck=0
type=rpm
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
$ cat /etc/os-release 
NAME="Fedora Linux"
VERSION="41 (Forty One)"
RELEASE_TYPE=stable

If seems to be one of the fedora-release* packages which are not up-to date.

You can set the repository version directly, for example

sudo dnf distro-sync --releasever=41
3 Likes

Thanks so much Villy Kruse! Adding --releasever=41 solved the issue indeed. I was very much concerned the instance is doomed.

Just to note – on some machines it did not work the first time, so I had to repeat the post-upgrade tasks twice or even thrice, with the --releasever=41.
Cheers.