Linux CentOS can not get updates from REPO

Somtime the linux machine can not get updates and you get this error:

"Failed to download metadata for repo AppStream"

This can happens if the repo URL is old or got corrupted some how, To fix this just replace the URL with a good and updated one like “vault.centos.org” , run from ssh or console :

cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Now you will be able to execute :

yum update
Or
dnf update

Good Luck

Leave a Reply

Your email address will not be published.