Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

General support questions
helmikuu
Posts: 9
Joined: 2012/09/07 20:32:21

Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by helmikuu » 2012/09/07 21:42:29

Please Help. I almost tried all the possible solutions from the internet but I cannot solve this issue. I am using putty and need to install some application but yum is not working from my ends. Here is the Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again.

Here are some of the info:




[root@hippo ~]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d



# in /etc/yum.repos.d
[root@hippo ~]# ^C
[root@hippo ~]# ls -1 /etc/yum.repos.d/
CentOS-Base.repo
CentOS-Debuginfo.repo
CentOS-Media.repo
CentOS-Vault.repo
repomd.xml
RPM-GPG-KEY-CentOS-Security-6
[


[root@hippo ~]# cat /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[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

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

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror.centos.org/centos/6.3/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirror.centos.org/centos/6.3/os/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror.centos.org/centos/6.3/os/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[root@hippo ~]#


pls help. :-?[code][root@hippo ~]# rpm -q yum ---> yum-3.2.29-30.el6.centos.noarch[/code]

User avatar
TrevorH
Forum Moderator
Posts: 24322
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by TrevorH » 2012/09/07 21:58:27

You should probably put back all the mirrorlist= lines that you've commented out in CentOS-Base.repo and comment out all the baseurl= lines that you've uncommented and pointed to a specific host.

Are you behind a web proxy or should you have direct access to the internet? If your company uses a web proxy then you probably need to tell yum about it - use `man yum.conf` and check for keywords starting with "proxy".

Can you resolve hosts by name? For example, can you ping www.google.com or does it say "unknown host"? If you are unable to resolve hosts by name then check /etc/resolv.conf for valid nameserver lines.

You probably shouldn't have repomd.xml and RPM-GPG-KEY-CentOS-Security-6 in the /etc/yum.repos.d directory but they are not the cause of your problems because yum only looks for *.repo files in there. I'm also not sure if that's a stray character in your post or if you really have a file called "[" in there too.

If none of this helps then please post the exact errors you get, cut and paste them so that it includes the line where you type `yum update` all the way through to the line where the prompt returns.

helmikuu
Posts: 9
Joined: 2012/09/07 20:32:21

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by helmikuu » 2012/09/07 22:12:07

Thanks for the reply.

I tried putting back all the mirror lists and comment the baseurl but it doesn't help.

[root@hippo yum.repos.d]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
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


I can ping google.com so I think I do not have problem with my internet connection. We are not also using proxy. About the stray character, I tried to remove it but it doesn't help.

:-(

User avatar
TrevorH
Forum Moderator
Posts: 24322
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by TrevorH » 2012/09/07 22:40:06

[quote]
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
[/quote]

That reveals a lot. Can you post the output of the `ifconfig` command. It's trying to connect on ipv6 so my guess is that you have no ipv4 address perhaps or maybe your nameserver is preferring ipv6 addresses? Could you also post the output of `nslookup mirrorlist.centos.org`

helmikuu
Posts: 9
Joined: 2012/09/07 20:32:21

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by helmikuu » 2012/09/07 23:10:41

Here are the results of the different commands.

[root@hippo ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 40:40:26:57:4B:F1
inet addr:50.56.232.246 Bcast:50.56.232.255 Mask:255.255.255.0
inet6 addr: fe80::4240:26ff:fe57:4bf1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58125 errors:0 dropped:0 overruns:0 frame:0
TX packets:46198 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11784807 (11.2 MiB) TX bytes:8795938 (8.3 MiB)
Interrupt:23

eth1 Link encap:Ethernet HWaddr 40:40:07:5C:4A:99
inet addr:10.178.51.180 Bcast:10.178.63.255 Mask:255.255.224.0
inet6 addr: fe80::4240:7ff:fe5c:4a99/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:690 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:460 (460.0 b) TX bytes:229596 (224.2 KiB)
Interrupt:22

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:54 errors:0 dropped:0 overruns:0 frame:0
TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4536 (4.4 KiB) TX bytes:4536 (4.4 KiB)



[root@hippo ~]# nslookup mirrorlist.centos.org
Server: 72.3.128.240
Address: 72.3.128.240#53

Non-authoritative answer:
Name: mirrorlist.centos.org
Address: 204.15.73.243
Name: mirrorlist.centos.org
Address: 64.235.47.134
Name: mirrorlist.centos.org
Address: 69.30.193.218
Name: mirrorlist.centos.org
Address: 72.232.223.58
Name: mirrorlist.centos.org
Address: 199.187.126.90
:-?

User avatar
TrevorH
Forum Moderator
Posts: 24322
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by TrevorH » 2012/09/07 23:38:34

I'm unsure of what is going on. You seem to have ipv4 addresses just fine (you might want to edit your previous post now and obscure the public one) but both your interfaces have link local ipv6 addresses and you've now exhausted my knowledge of ipv6 :-) The nslookup command returns ipv4 addresses correctly so I'm not quite sure why yum is then trying to connect on ipv6. I think you can work around the issue with a very big hammer by running

[code]
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.all.disable_ipv6=1
[/code]

This should disable ipv6 until you either reboot or run those same commands again and set them to 0. Once they're 1, try your original update - might want to do a `yum clean all` first just to make sure that nothing is cached. If you want those to be permanent then you can add them to /etc/sysctl.conf without the `sysctl -w` portion of the command and they'll take effect on reboot too. Disabling ipv6 is probably not the correct solution but will probably work.

helmikuu
Posts: 9
Joined: 2012/09/07 20:32:21

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by helmikuu » 2012/09/07 23:50:26

It doesn't fix the problem. Btw, thanks for you time. I hope somebody can help me about this.. I've been stuck in this for a whole night. :-?

User avatar
TrevorH
Forum Moderator
Posts: 24322
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by TrevorH » 2012/09/07 23:54:41

Do you still get the same error messages? Are there still ipv6 addresses listed in your `ifconfig` output? Did you do the `yum clean all` after disabling ipv6?

helmikuu
Posts: 9
Joined: 2012/09/07 20:32:21

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by helmikuu » 2012/09/08 00:18:16

Yes after trying the commands, I got the same results in ipconfig and nslookup mirrorlist.centos.org

and when trying to update yum...


[root@hippo ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
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

helmikuu
Posts: 9
Joined: 2012/09/07 20:32:21

Re: Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml)

Post by helmikuu » 2012/09/10 14:29:50

Hi there! I hope somebody can help me for this.

Locked