Use vault.centos.org as a yum source in CentOS 5

Keywords: CentOS RPM yum

The system of Aliyun CentOS 5 can not install application software with yum.  
 
Reason: CentOS 5 has ended its support from March 31, 2017, and no maintenance updates are provided. Therefore, the files including Ali Cloud Mirror Station may be out of date or some of them are missing.  
 
Environment: CentOS 5. X

Method

1. Keep only / etc/yum.repos.d/CentOS-Base.repo other files either deleted or suffixed

2. Edit the file/etc/yum.repos.d/CentOS-Base.repo and replace mirrors.aliyun.com/centos/$release ever with the corresponding historical source address and version number, such as vault.centos.org/5.11

Full File Download http://tadown.com/fs/6x1idado5g5g9vdip0/

[base]
name=CentOS-$releasever - Base
failovermethod=priority
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-5
http://mirrors.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates
failovermethod=priority
baseurl=http://vault.centos.org/5.11/updates/$basearch/
		http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-5
http://mirrors.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
failovermethod=priority
baseurl=http://vault.centos.org/5.11/extras/$basearch/
		http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-5
http://mirrors.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
failovermethod=priority
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
		http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-5
http://mirrors.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
failovermethod=priority
baseurl=http://vault.centos.org/5.11/contrib/$basearch/
		http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-5
http://mirrors.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-5

3. Confirm that there are no repo-terminated files in the / etc/yum.repos.d/ directory except CentOS-Base.repo, and delete them if necessary, then execute Yum clean all & Yum makecache updates and enable new Yum sources.

Posted by graham on Mon, 04 Feb 2019 21:51:16 -0800