How To Fix Failed to Download Metadata for Repo ‘AppStream’ on CentOS 8

[root@netshop-centos8-srv ~]# yum update
CentOS-8 - AppStream 110 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

Step 1 — Go to /etc/yum.repos.d/ directory

[root@netshop-centos8-srv ~]# cd /etc/yum.repos.d/

Step 2 — Run the following sed commands

[root@netshop-centos8-srv ~]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@netshop-centos8-srv ~]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Step 3 — Now run Yum Update

[root@netshop-centos8-srv ~]# yum update -y

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store