Errors during downloading metadata for repository 'fedora':

Hi,

I’m new to Fedora, but have some experience with Ubuntu as a user.
I got access to a remote computer where Fedora 35 is installed and when I try to install anything on the machine, it fails with some variations of this:

Errors during downloading metadata for repository 'fedora':
  - Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=fedora-35&arch=x86_64 (IP: 38.145.60.21)
  - Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=fedora-35&arch=x86_64 (IP: 18.159.254.57)
Error: Failed to download metadata for repo 'fedora': Cannot prepare internal mirrorlist: Status code: 404 for https://mirrors.fedoraproject.org/metalink?repo=fedora-35&arch=x86_64 (IP: 38.145.60.21)

The machine has connection to internet, i have installed miniconda by directly downloading the program and installing it.

I have also added
fastestmirror=false
to:
/etc/dnf/dnf.conf
as was suggested in other topic I found on this forum.
This error also appears if I try to run sudo dnf update --refresh

Thanks for any help

Try

sudo dnf clean all

followed by another

sudo dnf update

If it still fails after that, open /etc/yum.repos.d/fedora.repo and switch from metalink to baseurl.

Thanks for the quick repsonse.
I tried the sudo dnf clean all and sudo dnf update and still the same error.
What do you mean by switching from metalink to baseurl? Just rewriting the metalink to baseurl?
The content of the file is this now:

[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

Just uncommenting the baseurl and commenting metalink makes no sense as its a sample url and rewriting the metalink to baseurl gave me another error

Errors during downloading metadata for repository 'fedora':
  - Status code: 404 for https://mirrors.fedoraproject.org/metalink/repodata/repomd.xml?repo=fedora-35&arch=x86_64 (IP: 18.192.40.85)
Error: Failed to download metadata for repo 'fedora': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Simply change the hostname in the baseurl line to “download.fedoraproject.org” then uncomment that line and comment the metalink line. It still will use mirrors, but a different path to the data.

It is a sample hostname within that url. The remainder is valid.

While the metalink seems to be down the baseurl link seems to work for me.

I confirmed with my browser that the metalink seems unreachable at present. Another thread on the same topic.

2 Likes

thank you so much :slight_smile: this works