CentOS 8 yum update fails with Failed to download metadata for repo appstream
As of 31st December 2021, CentOS 8 has reached EOL status and will no longer receive any further updates. For users using CentOS 8, that change sparked an immediate discussion about migration options, and/or alternative arrangements for CentOS 8 long term support. in this article we look at available support options for CentOS 8.
To migrate from CentOS 8 and receive updates / security patches, we have 3 available options currently, namely,
-
CentOS 8 Stream
-
AlmaLinux 8
- Rocky Linux 8
First try to update your CentOS 8
yum update -y
Output:
[root@vps ~]# yum update -y
CentOS Linux 8 - AppStream 1.5 kB/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@vps ~]#
If you get the same error message as above, then you need to migrate your CentSO 8 installation to CentOS 8 Stream or AlmaLinux 8 or RockyLinux 8
How to migrate to CentOS 8 Stream
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
dnf install centos-release-stream
dnf swap centos-{linux,stream}-repos
dnf distro-sync
reboot
How to migrate to AlmaLinux 8
curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
chmod -v +x almalinux-deploy.sh
bash almalinux-deploy.sh
dnf distro-sync -y
reboot
How to migrate to RockyLinux 8
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
chmod +x migrate2rocky.sh
bash migrate2rocky.sh -r
reboot
Done.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS