Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)
-
- Posts: 319
- Joined: 2012/03/06 22:30:17
- Location: Ottawa
Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)
One problem is that you've apparently edited the [b]CentOS-Base.repo[/b] file and changed it. For example, your file says this:
[code]
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os
baseurl=http://mirror.centos.org/centos/6.3/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 [/code]
But it should say this:
[code]
[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[/code]
[b]TrevorH[/b] has already advised you to uncomment the mirrorlist line and comment the baseurl line, but that's not the only change you've made. Your mirrorlist line says [b]?release=6&arch=x86_64&repo=os[/b], but it should say [b]?release=$releasever&arch=$basearch&repo=os[/b]
So, please replace the first two sections of [b]/etc/yum.repos.d/CentOS-Base.repo[/b] with the default:
[code]
[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
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[/code]
Perhaps this will solve your problem, and perhaps not. If not, see if the file [b]/etc/sysconfig/network[/b] has this line:
[code]
NETWORKING_IPV6=yes
[/code]
If so, try using [b]TrevorH[/b]'s very big hammer by removing the line, and then:
[code]
service network restart
service NetworkManager restart
[/code]
If [b]yum[/b] now works, let's reinstall the original *.repo files to undo your ill-advised changes:
[code]
yum reinstall centos-release
[/code]
[code]
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os
baseurl=http://mirror.centos.org/centos/6.3/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 [/code]
But it should say this:
[code]
[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[/code]
[b]TrevorH[/b] has already advised you to uncomment the mirrorlist line and comment the baseurl line, but that's not the only change you've made. Your mirrorlist line says [b]?release=6&arch=x86_64&repo=os[/b], but it should say [b]?release=$releasever&arch=$basearch&repo=os[/b]
So, please replace the first two sections of [b]/etc/yum.repos.d/CentOS-Base.repo[/b] with the default:
[code]
[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
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[/code]
Perhaps this will solve your problem, and perhaps not. If not, see if the file [b]/etc/sysconfig/network[/b] has this line:
[code]
NETWORKING_IPV6=yes
[/code]
If so, try using [b]TrevorH[/b]'s very big hammer by removing the line, and then:
[code]
service network restart
service NetworkManager restart
[/code]
If [b]yum[/b] now works, let's reinstall the original *.repo files to undo your ill-advised changes:
[code]
yum reinstall centos-release
[/code]
Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)
Thanks for the reply. I have done all your suggestions but I am still getting this error.
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
Error: Cannot find a valid baseurl for repo: base
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
Error: Cannot find a valid baseurl for repo: base
-
- Posts: 319
- Joined: 2012/03/06 22:30:17
- Location: Ottawa
Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)
I suggest you ask in the Networking Support forum. You can refer to this thread for background.
Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)
Just an update. Problem solved by disabling the iptables. Thanks for all the help.
- AlanBartlett
- Forum Moderator
- Posts: 9345
- Joined: 2007/10/22 11:30:09
- Location: ~/Earth/UK/England/Suffolk
- Contact:
Yum Not Working: Error: Cannot retrieve repository metadata
[b]Johnson02[/b] -- Please do not hijack an existing thread with a totally unconnected problem.
Please take a look at the recommended reading for new members, especially the [url=https://www.centos.org/modules/newbb/viewforum.php?forum=54]FAQ & Readme First[/url]. Once you have read that information, then open your own thread in the appropriate forum for your current issue.
This thread is now locked.
Please take a look at the recommended reading for new members, especially the [url=https://www.centos.org/modules/newbb/viewforum.php?forum=54]FAQ & Readme First[/url]. Once you have read that information, then open your own thread in the appropriate forum for your current issue.
This thread is now locked.
Re: Yum Not Working: Error: Cannot retrieve repository metad
you shold add a valid ip as any ns in /etc/resolve.conf
ex:
nameserver 8.8.8.8
ex:
nameserver 8.8.8.8
-
- Posts: 1
- Joined: 2014/07/11 05:47:21
Re: Yum Not Working: Error: Cannot retrieve repository metad
it seams that if iptables is blocking outgoing http Connection over ipv4, ipv6 is tried. i ran into the same Problem. stopped the Firewall and yum returned to normal behavior. so allow outgoing http over ipv4.
Re: Yum Not Working: Error: Cannot retrieve repository metad
For what it's worth, I had the "Cannot retrieve repository metadata (repomd.xml)" because CentOS deprecated the path of the URL I had in my kickstart file. It was originally:
repo --name=base --baseurl=http://mirror.centos.org/centos/6.5/os/$basearch
and had to be changed to:
repo --name=base --baseurl=http://mirror.centos.org/centos/6/os/$basearch
The "6.5" sub directory was removed and rolled in to "6", and I did not know this was a normal thing.
repo --name=base --baseurl=http://mirror.centos.org/centos/6.5/os/$basearch
and had to be changed to:
repo --name=base --baseurl=http://mirror.centos.org/centos/6/os/$basearch
The "6.5" sub directory was removed and rolled in to "6", and I did not know this was a normal thing.
Re: Yum Not Working: Error: Cannot retrieve repository metad
Okay this is a little more difficult.
I'm not a fan of disabling IPv6 - y0ou're just delaying the inventiable.
Please backup /etc/sysconfig/ip6tables (to something like ip6tables.orig).
Then create a new ip6tables file with the following:
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-reply -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type destination-unreachable -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-request -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type no-route -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type redirect -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type time-exceeded -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type communication-prohibited -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type address-unreachable -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type port-unreachable -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type packet-too-big -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-solicitation -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-advertisement -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 80 -j REJECT --reject-with icmp6-adm-prohibited
-A INPUT -j REJECT --reject-with icmp6-adm-prohibited
-A FORWARD -j REJECT --reject-with icmp6-adm-prohibited
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-reply -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type destination-unreachable -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-request -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type no-route -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type redirect -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type time-exceeded -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type communication-prohibited -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type address-unreachable -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type port-unreachable -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type packet-too-big -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-solicitation -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-advertisement -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A OUTPUT -j REJECT --reject-with icmp6-adm-prohibited
COMMIT
Then restart ip6tables with /etc/init.d/ip6tables restart
If that works, please post back so we can tackle the root cause of the problem.
If it doesn't work please post back with the output of:
cat /etc/resolv.conf
hostname -fqdn
dnsdomainname
host mirror.centos.org
NOTE: This is (nearly) 100% not supported and a (nearly) 100% bad practise, but we're troubleshooting here, we'll clean up later.
Cheers
I'm not a fan of disabling IPv6 - y0ou're just delaying the inventiable.
Please backup /etc/sysconfig/ip6tables (to something like ip6tables.orig).
Then create a new ip6tables file with the following:
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-reply -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type destination-unreachable -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-request -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type no-route -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type redirect -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type time-exceeded -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type communication-prohibited -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type address-unreachable -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type port-unreachable -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type packet-too-big -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-solicitation -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-advertisement -j ACCEPT
-A INPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 80 -j REJECT --reject-with icmp6-adm-prohibited
-A INPUT -j REJECT --reject-with icmp6-adm-prohibited
-A FORWARD -j REJECT --reject-with icmp6-adm-prohibited
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-reply -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type destination-unreachable -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type echo-request -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type no-route -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type redirect -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type time-exceeded -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type communication-prohibited -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type address-unreachable -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type port-unreachable -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type packet-too-big -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-solicitation -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type router-advertisement -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-solicitation -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type neighbour-advertisement -j ACCEPT
-A OUTPUT -p ipv6-icmp -m ipv6-icmp --icmpv6-type parameter-problem -j ACCEPT
-A OUTPUT -j REJECT --reject-with icmp6-adm-prohibited
COMMIT
Then restart ip6tables with /etc/init.d/ip6tables restart
If that works, please post back so we can tackle the root cause of the problem.
If it doesn't work please post back with the output of:
cat /etc/resolv.conf
hostname -fqdn
dnsdomainname
host mirror.centos.org
NOTE: This is (nearly) 100% not supported and a (nearly) 100% bad practise, but we're troubleshooting here, we'll clean up later.
Cheers
-
- Posts: 1
- Joined: 2015/04/17 10:25:30
Re: Yum Not Working: Error: Cannot retrieve repository metad
try to reboot your computer then yum update.
This works for me.
This issue somehow occurred when you stop yum install.
Hope this woks.
This works for me.
This issue somehow occurred when you stop yum install.
Hope this woks.