I have set up a centOS 6.5 server
using VMWare Workstation 9
on a Windows 8.1
host laptop. When trying to use yum
to ins
Comment out metadata_expire directive in /etc/yum.conf and do yum clean all. This worked for me. Not sure how.
This happened to a system I support on a remote network and I determined it was due to the customer's Check Point firewall interfering with normal HTTP traffic. I ran a sudo tcpdump -nn -c 500 -s0 -X port 80
and watched yum get redirected to some kind of portal:
Location: http://x.x.x.x/UserCheck/PortalMain?....
Funny thing is, it was hard to reproduce with curl
, which retrieved the mirror list without any problem. I found I had to add the User-agent: urlgrabber/3.1.0 yum/3.2.22
HTTP header that yum
uses to trigger Check Point interfering, like this:
$ curl -i \
-H 'User-agent: urlgrabber/3.1.0 yum/3.2.22' \
'http://108.61.16.227/?release=5&arch=x86_64&repo=os'
HTTP/1.1 307 Temporary Redirect
Location: http://x.x.x.x/UserCheck/PortalMain?IID=....origUrl=....
Connection: close
Googling for UserCheck/PortalMain shows this is Check Point Firewall. And the IP I obscured there (x.x.x.x
) belonged to the customer. This was sufficient proof to tell the customer he needed to make some kind of change to his firewall to allow my system unobstructed internet access (I have no idea what, but I hope he and/or his network team can figure it out).
For anybody else stuck in the past,
From within a docker container centos:centos5
# cat CentOS-Base.repo
[base]
name=CentOS-5.11 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=5.11&arch=$basearch&repo=os
baseurl=http://archive.kernel.org/centos-vault/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-5.11 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=5.11&arch=$basearch&repo=updates
baseurl=http://archive.kernel.org/centos-vault/5.11/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-5.11 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=5.11&arch=$basearch&repo=addons
baseurl=http://archive.kernel.org/centos-vault/5.11/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5.11 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=5.11&arch=$basearch&repo=extras
baseurl=http://archive.kernel.org/centos-vault/5.11/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-5.11 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=5.11&arch=$basearch&repo=centosplus
baseurl=http://archive.kernel.org/centos-vault/5.11/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-5.11 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=5.11&arch=$basearch&repo=contrib
baseurl=http://archive.kernel.org/centos-vault/5.11/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
I had to also change this libselinux.repo
# cat libselinux.repo
[libselinux]
name=CentOS-$releasever - libselinux
baseurl=http://archive.kernel.org/centos-vault/5.11/os/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
includepkgs=libselinux*
for centos 5.4, you can change /etc/yum.repos.d/CentOS-Base.repo
into like this.
[base]
name=CentOS-5.4 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=os
baseurl=http://vault.centos.org/5.4/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-5.4 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=updates
baseurl=http://vault.centos.org/5.4/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-5.4 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=addons
baseurl=http://vault.centos.org/5.4/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5.4 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=extras
baseurl=http://vault.centos.org/5.4/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-5.4 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=centosplus
baseurl=http://vault.centos.org/5.4/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-5.4 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=contrib
baseurl=http://vault.centos.org/5.4/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Here we need to only put correct baseurl in /etc/yum.repos.d/CentOS-Base.repo
check this URL http://mirror.cisp.com browse your OS and take that URL
If you have Centos6.10 then your baseurl as follow
baseurl=http://mirror.cisp.com/CentOS/6.10/
Adding the following before yum update -y
helped me to fix the problem:
yum clean all
echo "http://vault.centos.org/5.11/os/x86_64/" > /var/cache/yum/base/mirrorlist.txt
echo "http://vault.centos.org/5.11/extras/x86_64/" > /var/cache/yum/extras/mirrorlist.txt
echo "http://vault.centos.org/5.11/updates/x86_64/" > /var/cache/yum/updates/mirrorlist.txt
BTW, CentOS 5 had already reached EOL