Fix: “Error: Failed to download metadata for repo ‘appstream'” (CentOS 8)

Previously, we saw which 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 no more updates For CentOS 8.

Error: Failed to download metadata for repo 'appstream': cannot prepare internal mirrorlist: no url in mirrorlist

Error: Failed to download metadata for repo ‘appstream’

If you still manage the system running CentOS 8 and you try to update the packages using dnf update either yum updateYou will face 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 alternate distro

Now that CentOS has moved to Stream – a rolling-release Linux distribution, in the midst of upstream development fedora and for downstream development Rayleigh – Many users are moving to CentOS alternatives. Others have decided to stay with CentOS by migrating to CentOS Stream 8. Both of these options will resolve not being able to update to CentOS 8.

To migrate from CentOS 8 to CentOS Stream 8, run the following command:

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync

Migrating to alternative distros is usually as simple as:

for example, follow this guide To migrate from CentOS 8 or CentOS Stream 8 to Rocky Linux. see also full list of CentOS 8 Alternatives,

Leave a Comment