LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Could not retrieve mirrorlist...error was 12: Timeout on... (https://www.linuxquestions.org/questions/linux-newbie-8/could-not-retrieve-mirrorlist-error-was-12-timeout-on-4175471407/)

danndp 07-30-2013 12:46 AM

Could not retrieve mirrorlist...error was 12: Timeout on...
 
Hi,
I'm having this problem, i can't install any package with yum; i used a live CD of Centos 6.3

Following my system specifications:

Code:

[root@asterisk01 ~]# cat /etc/issue
CentOS release 6.3 (Final)
Kernel \r on an \m

[root@asterisk01 ~]# uname -a
Linux asterisk01.calalab.lab 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

This is the error i'm getting:

Code:

[root@asterisk01 ~]# yum update
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
12: Timeout on http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os: (28, 'connect() timed out!')
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras error was
12: Timeout on http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras: (28, 'connect() timed out!')
.
.

I do have network connection:

Code:

[root@asterisk01 ~]# nslookup google.com
Server:        192.168.1.224
Address:        192.168.1.224#53

Non-authoritative answer:
Name:  google.com
Address: 173.194.37.132
Name:  google.com
Address: 173.194.37.137
Name:  google.com
Address: 173.194.37.136
Name:  google.com
Address: 173.194.37.134
Name:  google.com
Address: 173.194.37.131
Name:  google.com
Address: 173.194.37.142
Name:  google.com
Address: 173.194.37.130
Name:  google.com
Address: 173.194.37.129
Name:  google.com
Address: 173.194.37.128
Name:  google.com
Address: 173.194.37.133
Name:  google.com
Address: 173.194.37.135

My network interface:

Code:

[root@asterisk01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
IPADDR=192.168.1.216
NETMASK=255.255.255.0
NETWORK=192.168.1.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
DNS1=192.168.1.224
DNS2=192.168.1.248
BROADCAST=192.168.1.255
ONBOOT=yes
NAME=eth0
TYPE=Ethernet
HWADDR=00:14:c2:0e:5e:4c
BOOTPROTO=none
GATEWAY=192.168.1.1
SYSCTL=yes

/etc/sysconfig/network

Code:

[root@asterisk01 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=asterisk01.calalab.lab
NETWORKING_IPV6=no

/etc/sysctl:

Code:

[root@asterisk01 ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Disable netfilter on bridges.
# net.bridge.bridge-nf-call-ip6tables = 0
# net.bridge.bridge-nf-call-iptables = 0
# net.bridge.bridge-nf-call-arptables = 0

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296

/etc/yum.conf:

Code:

[root@asterisk01 ~]# 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

/etc/yum.repos.d/CentOS-Base.repo

Code:

[root@asterisk01 ~]# cat /etc/yum.repos.d/CentOS-Base.repo
[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
#
##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-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/$releasever/centosplus/$basearch/
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/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Hope you can help


SAbhi 07-30-2013 01:27 AM

The default repo file for centos base has baseurl commented out, it is the mirrors which should look for the repository and get you the packages. Can I ask you why have you remove the "#" comment from baseurl. Also do you have IPTABLES enabled on your system and Yum is allowed to communicate ?

danndp 07-30-2013 10:49 AM

Quote:

Originally Posted by SAbhi (Post 4999382)
The default repo file for centos base has baseurl commented out, it is the mirrors which should look for the repository and get you the packages. Can I ask you why have you remove the "#" comment from baseurl. Also do you have IPTABLES enabled on your system and Yum is allowed to communicate ?

Hi,

I've commented again the repos like this:

Code:

[root@asterisk01 ~]# cat /etc/yum.repos.d/CentOS-Base.repo
[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
#
##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-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/$releasever/centosplus/$basearch/
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/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

But i'm still having the same issue, iptables service is stopped

More ideas please?

Thanks so much

SAbhi 07-30-2013 08:27 PM

ok.. is that the same error you got ? if yes lets try some other thing, this time comment out the mirror list and uncomment the baseurl.

yum clean all #do not forget to do this every time you change the repo file.
ping mirror.centos.org #just to check if the server in pinging via your network.
yum update #try running the update

danndp 08-07-2013 04:40 PM

Quote:

Originally Posted by SAbhi (Post 4999938)
ok.. is that the same error you got ? if yes lets try some other thing, this time comment out the mirror list and uncomment the baseurl.

yum clean all #do not forget to do this every time you change the repo file.
ping mirror.centos.org #just to check if the server in pinging via your network.
yum update #try running the update

Hi,

After chaging the file like the following:

Code:

# 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=$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

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

Then:

Code:

yum clean all
And now the error i have is the following:

Code:

[root@opensips01 /]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@opensips01 /]# yum -y update
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

This is driving me crazy!!!

I can't ping mirror.centos.org:

Code:

[root@opensips01 /]# ping mirror.centos.org
PING mirror.centos.org (208.74.124.34) 56(84) bytes of data.
.
.
.
.

I do have network connection:

Code:

[root@opensips01 /]# nslookup google.com
Server:        192.168.1.224
Address:        192.168.1.224#53

Non-authoritative answer:
Name:  google.com
Address: 74.125.229.174
Name:  google.com
Address: 74.125.229.164
Name:  google.com
Address: 74.125.229.165
Name:  google.com
Address: 74.125.229.160
Name:  google.com
Address: 74.125.229.166
Name:  google.com
Address: 74.125.229.169
Name:  google.com
Address: 74.125.229.167
Name:  google.com
Address: 74.125.229.162
Name:  google.com
Address: 74.125.229.161
Name:  google.com
Address: 74.125.229.168
Name:  google.com
Address: 74.125.229.163

What else could i check? is the first time it happens to me

Thanks

SAbhi 08-07-2013 11:12 PM

hmmm.. dont know how to overcome this:

Can you share /etc/resolv.conf file, just to confirm it is checking your primary name server at the first place.

Also try pinging some other domain www.yahoo.com.


All times are GMT -5. The time now is 08:39 AM.