Previously, we looked at What CentOS alternative distro should you choose? That article was posted before End of Life (EOL) for CentOS 8 – December 31st, 2021. CentOS 8 will NOT automatically migrate to the next version (CentOS Stream 8). There will be no more updates to CentOS 8.
Error: Failed to download metadata for repo ‘appstream’
If you still manage system’s running CentOS 8 and you attempt to update packages using dnf update
or yum update
, you will encounter the following error:
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
Solution: Migrate to CentOS Stream 8 or an alternative distro
Now that CentOS has shifted to Stream – a rolling-release Linux distribution, midstream between the upstream development in Fedora and the downstream development for RHEL – many users are moving to CentOS alternatives. Others have decided to stick with CentOS by migrating to CentOS Stream 8. Both of these choices will resolve not being able to update CentOS 8.
To migrate from CentOS 8 to CentOS Stream 8, run the following commands:
dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync
Migrating to alternative distros is usually just as simple:
For example, follow this guide to migrate from CentOS 8 or CentOS Stream 8 to Rocky Linux. Also, see this full list of CentOS 8 alternatives.
source: https://haydenjames.io/fix-error-failed-to-download-metadata-for-repo-appstream-centos-8/