centos Fix Error “Cannot retrieve repository metadata” for Yum

Tutorial centos how to Fix Error Cannot retrieve repository metadata for Yum ?

# yum provides system-config-network
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: centos.vr-zone.com
 * extras: centos.vr-zone.com
 * updates: centosz4.centos.org
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

This problem can be fixed by uncommenting ‘baseurl’ in repository configuration file. For example: File:CentOS-Base.repo Original:

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
..
..
..

Change to:

tutorial centos
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
..
..
..

If this doesn’t solve the problem, then it is something to do with network connection.
you can try check use command :

ping google.com

or another host

check your network config with command

ifconfig

Comments are closed.

Post Navigation