Error: Failed to download metadata for repo 'baseos' / 'appstream' - Centos 8
I'm receiving the following error when I run yum update
:
- Status code: 404 for http://mirrors.linode.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 2600:3c00:1::68c8:17a2)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
How can I resolve this?
6 Replies
The reason you're seeing this error is because CentOS 8 went EOL 12/31/21 (deadline extended to today - 1/31/22), and the official repo was moved to vault.centos.org. Therefore, we do not keep mirrors for this anymore.
The following page provides more information on this:
https://www.centos.org/centos-linux-eol/
Therefore, you may want to consider using CentOS 7 (EOL 2024-06-30) or CentOS Stream 8 (EOL 2024-05-31).
While it's not recommended, if you prefer to continue using CentOS 8 for the time being, you can do the following:
- Open your
CentOS-Linux-AppStream.repo
andCentOS-Linux-BaseOS.repo
files in vim or nano. - Comment out:
CentOS-Linux-BaseOS.repo
#baseurl=http://mirrors.linode.com/$contentdir/$releasever/BaseOS/$basearch/os/
CentOS-Linux-AppStream.repo
#baseurl=http://mirrors.linode.com/$contentdir/$releasever/AppStream/$basearch/os/
- Add the following line to each respective file:
CentOS-Linux-BaseOS.repo
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
CentOS-Linux-AppStream.repo
baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
- Save each file and exit.
- Run
yum update
again.
We will continue to offer Centos 8 for six months after EOL and will mark the Centos 8 distro as deprecated soon so as not to cause further confusion.
Open your CentOS-Linux-AppStream.repo and CentOS-Linux-BaseOS.repo files in vim or nano.
Just to add these files are located in /etc/yum.repos.d (took me a while to find them). This fixed the problem.
For me, with a fresh Linode image install of CentOS Stream 9 Disk, I had to log in an run:
dnf config-manager --set-enabled crb
dnf install epel-release epel-next-release
as documented via https://docs.fedoraproject.org/en-US/epel/
along with a
yum update
and reboot, I was done and went on to installing Longview
I had to do a bit more than listed above. In the end, I move side the contents of /etc/yum.repos.d and created the following file:
CentOS-Base.repo (contents).
[baseos]
name=CentOS Linux $releasever - BaseOS
baseurl=https://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[appstream]
name=CentOS Linux $releasever - AppStream
baseurl=https://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=CentOS Linux $releasever - Extras
baseurl=https://vault.centos.org/$contentdir/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[centosplus]
name=CentOS Linux $releasever - Plus
baseurl=https://vault.centos.org/$contentdir/$releasever/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial