It`s simple when you know how ! CentOS,Linux,Tutorials Linux CentOS can not get updates from REPO

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-*

This is example of how CentOS-Linux-BaseOS.repo :

[baseos]
name=CentOS Linux $releasever - BaseOS
#mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://vault.epel.cloud/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

Now you will be able to execute :

yum update
Or
dnf update

Some time you will need to run “clean all” to reset the package list:

yum clean all

I had an indecent with this error :

Module yaml error: Unexpected key in data: static_context [line 9 col 3]

The solution is simple, just upgrade the module:

dnf update libmodulemd

Now run again the update

Good Luck

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How To Completely Uninstall All Version Of Microsoft OfficeHow To Completely Uninstall All Version Of Microsoft Office

Microsoft released easy uninstallers for all version of Office, just browse to this page and choose your office version : https://support.office.com/en-us/article/Uninstall-Office-from-a-PC-9dd49b83-264a-477a-8fcc-2fdf5dbf61d8?ui=en-US&rs=en-US&ad=US#OfficeVersion=2016 You need to select the version you have ad