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 “” , 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=|baseurl=|g' /etc/yum.repos.d/CentOS-*

Now you will be able to execute :

yum update
dnf update

Good Luck

Leave a Reply

Your email address will not be published.