Yum update error - connection timed out

General support questions including new installations
sicoanimal
Posts: 23
Joined: 2009/09/10 13:12:17
Location: Oxford, UK
Contact:

Yum update error - connection timed out

Post by sicoanimal » 2009/09/11 04:08:35

I have just installed CentOS 5.3 on an old PC hoping to use it as a web server.

I have been following the guide below as I am relatively new to Linux:

[url=http://www.howtoforge.com/centos-5.1-server-lamp-email-dns-ftp-ispconfig]http://www.howtoforge.com/centos-5.1-server-lamp-email-dns-ftp-ispconfig[/url]

When I try to run 'yum update' it fails with the below output:

[code]
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Error: Cannot find a valid baseurl for repo: base
[/code]

I am pretty sure the internet connection is working fine, as I can successfully ping 'google.com' with these results:

[code]
PING google.com (74.125.67.100) 56(84) bytes of data.
64 bytes from google.com (74.125.67.100): icmp_seq=1 ttl=53 time=118 ms
64 bytes from google.com (74.125.67.100): icmp_seq=2 ttl=53 time=117 ms
64 bytes from google.com (74.125.67.100): icmp_seq=3 ttl=53 time=118 ms
64 bytes from google.com (74.125.67.100): icmp_seq=4 ttl=53 time=117 ms
64 bytes from google.com (74.125.67.100): icmp_seq=5 ttl=53 time=118 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3996ms
rtt min/avg/max/mdev = 117.455/118.004/118.452/0.490 ms
[/code]

I have been scouring the internet for a couple of days and have not found anything that has fixed my problem.

A few place suggested editing the file '/etc/yum.repos.d/CentOS-Base.repo' and removing a hash (#) from the line beginning '#baseurl=' but this did not fix my problem. However, the output from 'yum update' changed to:

[code]
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Error: Cannot find a valid baseurl for repo: updates
[/code]

Any help with this would be much appreciated.

KermitDaFragger
Posts: 195
Joined: 2009/09/11 19:23:05
Location: the Netherlands

Re: Yum update error - connection timed out

Post by KermitDaFragger » 2009/09/11 19:44:36

[quote]
A few place suggested editing the file '/etc/yum.repos.d/CentOS-Base.repo' and removing a hash (#) from the line beginning '#baseurl=' but this did not fix my problem. However, the output from 'yum update' changed to:

[code]
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=os error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=updates error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Error: Cannot find a valid baseurl for repo: updates
[/code]
[/quote]

Uncommenting the BaseURL might help, but as you can see yum still tries to fetch the mirrorlist. You need to comment out the mirrorlist entry (ie. put a # in front of it) to work correctly. Could you also paste your entire CentOS-Base.repo file if that still doesnt work ?

sicoanimal
Posts: 23
Joined: 2009/09/10 13:12:17
Location: Oxford, UK
Contact:

Re: Yum update error - connection timed out

Post by sicoanimal » 2009/09/12 01:14:59

I have commented out the 'mirrorlist=...' line now, and this is the contents of my 'CentOS-Base.repo' file:
[code]
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# 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=$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-5

#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-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#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/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#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/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#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/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[/code]

After running 'yum update' this is the output I got:
[code]
Loaded plugins: fastestmirror
Determining fastest mirrors
* updates: mirror.bytemark.co.uk
* addons: mirror.bytemark.co.uk
* extras: mirror.bytemark.co.uk
http://mirror.centos.org/centos/5/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout: <urlopen error timed out>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[/code]

KermitDaFragger
Posts: 195
Joined: 2009/09/11 19:23:05
Location: the Netherlands

Re: Yum update error - connection timed out

Post by KermitDaFragger » 2009/09/12 10:20:18

Weird. I'm no YUM expert but my guess is that it uses CURL under the hood.

Does this work ? :

curl http://mirror.centos.org/centos/5/os/i386/

sicoanimal
Posts: 23
Joined: 2009/09/10 13:12:17
Location: Oxford, UK
Contact:

Re: Yum update error - connection timed out

Post by sicoanimal » 2009/09/12 12:22:15

[quote]
KermitDaFragger wrote:
Weird. I'm no YUM expert but my guess is that it uses CURL under the hood.

Does this work ? :

curl http://mirror.centos.org/centos/5/os/i386/[/quote]

On running that command I got the output:

[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /centos/5/os/i386</title>
</head>
<body>
<table bgcolor=#3399FF text=#000000 cellSpacing=0 cellPadding=0 width="100%" border=0 align="center">
<tbody>
<tr>
<td vAlign=top>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="66">
<tr>
<td colspan="1" rowspan="1" style="vertical-align: middle; text-align: left; width: 63px">
<a href="http://www.centos.org/"><img src="/HEADER.images/centos_icon_60.png" alt="CentOS Icon" border="0" /></a>
</td>
<td colspan="1" rowspan="1" style="vertical-align: middle; text-align: left; ">
<a href="http://www.centos.org/"><img src="/HEADER.images/centos_logo_45.png" alt="CentOS Logo" border="0" /></a>
</td>
<td width="100%" align="right">
</td>
</tr>
</table>
</td>

</tr>
</tbody>
</table>
<table bgcolor="#e0d2e3" text=#5e5e5e cellSpacing=0 cellPadding=0 width="100%" border=0 align="center">
<tbody>
<tr>
<td vAlign=top>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="25">
<tr>
<td valign=center> <font size=4 face="Verdana, Arial, Helvetica, sans-serif" color=#000000>
<b>CentOS on the Web: <a href="http://www.centos.org/modules/tinycontent/index.php?id=16">Mailing Lists
</a> | <a href="http://www.centos.org/modules/tinycontent/index.php?id=13">Mirror List</a> |
<a href="http://www.centos.org/modules/tinycontent/index.php?id=8">IRC</a> |
<a href="http://www.centos.org/modules/newbb/">Forums</a> | <a href="http://bugs.centos.org/">Bugs
</a> | <a href="http://www.centos.org/modules/tinycontent/index.php?id=23">Donate</a> </b></font></td>
</tr>
</table>
</td>

</tr>
</tbody>
</table>
<table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th>
<a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">
Description</a></th></tr><tr><th colspan="5"><hr></th></tr>
<tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/centos/5/os/">
Parent Directory</a></td><td> </td><td align="right"> - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="CentOS/">CentOS/</a>
</td><td align="right">29-Mar-2009 15:46 </td><td align="right"> - </td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="EULA">EULA</a></td>
<td align="right">14-Jun-2008 22:32 </td><td align="right">212 </td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="GPL">GPL</a></td>
<td align="right">14-Jun-2008 22:32 </td><td align="right"> 18K</td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="NOTES/">NOTES/</a>
</td><td align="right">17-Mar-2009 01:30 </td><td align="right"> - </td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-cs">
RELEASE-NOTES-cs</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">655 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-cs.html">
RELEASE-NOTES-cs.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.4K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-de">
RELEASE-NOTES-de</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">839 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-de.html">
RELEASE-NOTES-de.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.5K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-en">
RELEASE-NOTES-en</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">694 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-en.html">
RELEASE-NOTES-en.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.3K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-en_US">
RELEASE-NOTES-en_US</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">694 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-en_US.html">
RELEASE-NOTES-en_US.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.3K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-es">
RELEASE-NOTES-es</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">788 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-es.html">
RELEASE-NOTES-es.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.6K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-fr">
RELEASE-NOTES-fr</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">852 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-fr.html">
RELEASE-NOTES-fr.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.6K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-ja">
RELEASE-NOTES-ja</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">766 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-ja.html">
RELEASE-NOTES-ja.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.5K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-nl">
RELEASE-NOTES-nl</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">706 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-nl.html">
RELEASE-NOTES-nl.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.4K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-pt_BR">
RELEASE-NOTES-pt_BR</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">752 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-pt_BR.html">
RELEASE-NOTES-pt_BR.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.4K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RELEASE-NOTES-ro">
RELEASE-NOTES-ro</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">801 </td></tr>
<tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="RELEASE-NOTES-ro.html">
RELEASE-NOTES-ro.html</a></td><td align="right">09-Mar-2009 03:12 </td><td align="right">1.4K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RPM-GPG-KEY-CentOS-5">
RPM-GPG-KEY-CentOS-5</a></td><td align="right">14-Jun-2008 22:32 </td><td align="right">1.5K</td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="RPM-GPG-KEY-beta">
RPM-GPG-KEY-beta</a></td><td align="right">14-Jun-2008 22:32 </td><td align="right">1.5K</td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="images/">images/</a>
</td><td align="right">21-Mar-2009 15:04 </td><td align="right"> - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="isolinux/">isolinux/</a>
</td><td align="right">21-Mar-2009 14:46 </td><td align="right"> - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="repodata/">repodata/</a>
</td><td align="right">21-Mar-2009 14:35 </td><td align="right"> - </td></tr>
<tr><th colspan="5"><hr></th></tr>
</table>
<table bgcolor="#e0d2e3" text=#5e5e5e cellSpacing=0 cellPadding=0 width="100%" border=0 align="center">
<tbody>
<tr>
<td vAlign=top>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="25">
<tr>
<td valign=center align=left> <font size=2 face="Verdana, Arial, Helvetica, sans-serif" color=#000000><b>
This CentOS server donated by: <a href="http://www.fasthosts.co.uk/">Fasthosts Internet Ltd</a></b></font></td>
<td valign=center align=right> <font size=2 face="Verdana, Arial, Helvetica, sans-serif" color=#000000><b>
I want to donate a server: <a href="mailto:donate@centos.org?subject=Server Donation">Contact us</a></b></font></td>
</tr>
</table>
</td>

</tr>
</tbody>
</table>
</body></html>
[/code]

I am guessing this is what it should have been but I have never heard of the curl command.

KermitDaFragger
Posts: 195
Joined: 2009/09/11 19:23:05
Location: the Netherlands

Re: Yum update error - connection timed out

Post by KermitDaFragger » 2009/09/12 13:35:30

I take it you have tried running yum clean all and then retried running yum update ?

You can try to figure out what goes wrong with strace. I don't think its installed by default in CentOs so you might have to install it from CD/ DVD. After its installed you can run

strace yum update

after which your screen will be flooded :-) But it gives insight into what is happening.

sicoanimal
Posts: 23
Joined: 2009/09/10 13:12:17
Location: Oxford, UK
Contact:

Re: Yum update error - connection timed out

Post by sicoanimal » 2009/09/12 14:33:34

It appears that strace was installed along with CentOS but I lost the majority of the output (scrolled off the top of the screen) so I am going to try and save it to a log file.

I will post the output as soon as I can.

sicoanimal
Posts: 23
Joined: 2009/09/10 13:12:17
Location: Oxford, UK
Contact:

Re: Yum update error - connection timed out

Post by sicoanimal » 2009/09/12 15:27:41

I have been running 'yum clean all' every time before 'yum update'.

Here is a link to the output of 'strace yum update':

[url=http://sicowebsites.110mb.com/putty.log]http://sicowebsites.110mb.com/putty.log[/url]

--EDIT--
I have looked through the output now, but I can not make head nor tail out of it.

User avatar
toracat
Site Admin
Posts: 7518
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Yum update error - connection timed out

Post by toracat » 2009/09/12 16:12:28

Are you using a proxy server? If so, is the yum.conf file set up properly?

sicoanimal
Posts: 23
Joined: 2009/09/10 13:12:17
Location: Oxford, UK
Contact:

Re: Yum update error - connection timed out

Post by sicoanimal » 2009/09/12 16:28:30

[quote]
toracat wrote:
Are you using a proxy server? If so, is the yum.conf file set up properly?[/quote]

No, I am not using a proxy server.

Post Reply