How to switch Fedora variants for dnf in a system broken after upgrade 42->43?

Some users have reported problems with the /etc/yum.repos.d/fedora.repo and /etc/yum.repos.d/fedora-updates files. It seems some have a file that replaces the $releasever part seen below with 42 and as such cannot read any other repo for the upgrades.

$ cat /etc/yum.repos.d/fedora.repo 
[fedora]
name=Fedora $releasever - $basearch
#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
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

If you check that file with the command grep 42 /etc/yum.repos.d/fedora.repo and find that it has 42 where mine shown above has $releasever then the file must be edited to contain the $releasever instead.

Similarly check the /etc/yum.repos.d/fedora-updates.repo file to see if it may have the same error. Here is one case where that was seen.

and specifically

nano /etc/yum.repos.d/fedora-updates.repo

  GNU nano 8.3                                /etc/yum.repos.d/fedora-updates.repo                                          
[updates]
name=Fedora $releasever - $basearch - Updates
#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/$basearch/
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/updates/42/Everything/x86_64/
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
2 Likes