Transferred from {
Http://apps.hi.baidu.com/share/detail/14082265
Http://menjoy.javaeye.com/blog/638457
}
Step 2
Back up the yum configuration file and modify the yum configuration file.
CP/etc/yum. Repos. d/CentOS-Base.repo CentOS-Base.repo_bak
VI/etc/yum. Repo. d/CentOS-Base.repo
You can use the USTC Yum source or the SJTU Yum source. You can select either of them.
Cover the CentOS-Base.repo with the following content.
# USTC Yum source, the latest in http://centos.ustc.edu.cn/centos/5,
# Can also be set to http://centos.ustc.edu.cn/centos/5.5/
[Base]
CentOS-5-Base
Baseurl = http://centos.ustc.edu.cn/centos/5/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Released updates
[Update]
CentOS-5-Updates
Baseurl = http://centos.ustc.edu.cn/centos/5/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Packages used/produced in the build but not released
[Addons]
CentOS-5-Addons
Baseurl = http://centos.ustc.edu.cn/centos/5/addons/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Additional packages that may be useful
[Extras]
Name = CentOS-5-extras
Baseurl = http://centos.ustc.edu.cn/centos/5/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# additional packages that extend functionality of existing packages
[centosplus]
name = CentOS-5-plus
baseurl = http://centos.ustc.edu.cn/centos/5/centosplus/?basearch/
gpgcheck = 1
enabled = 0
gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# Contrib-packages by centos users
[Contrib]
Name = CentOS-5-contrib
Baseurl = http://centos.ustc.edu.cn/centos/5/contrib/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
# End Part 1
#================ Split line ==================Note: select only one of the upper and lower parts.
# USTC Yum source, the latest in http://ftp.sjtu.edu.cn/centos/5,
# Can also be set to http://ftp.sjtu.edu.cn/centos/5.5/
[Base]
CentOS-5-Base
Baseurl = http://ftp.sjtu.edu.cn/centos/5/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Released updates
[Update]
CentOS-5-Updates
Baseurl = http://ftp.sjtu.edu.cn/centos/5/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Packages used/produced in the build but not released
[Addons]
CentOS-5-Addons
Baseurl = http://ftp.sjtu.edu.cn/centos/5/addons/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Additional packages that may be useful
[Extras]
Name = CentOS-5-extras
Baseurl = http://ftp.sjtu.edu.cn/centos/5/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# additional packages that extend functionality of existing packages
[centosplus]
name = CentOS-5-plus
baseurl = http://ftp.sjtu.edu.cn/centos/5/centosplus/?basearch/
gpgcheck = 1
enabled = 0
gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Contrib-packages by centos users
[Contrib]
Name = CentOS-5-contrib
Baseurl = http://ftp.sjtu.edu.cn/centos/5/contrib/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# Part 2 ends
Step 2
USTC Yum Source
32-bit: rpm -- import http://centos.ustc.edu.cn/centos/5/ OS /i386/RPM-GPG-KEY-CentOS-5
64-bit: rpm -- import http://centos.ustc.edu.cn/centos/5/ OS /x86_64/RPM-GPG-KEY-CentOS-5
Shanghai Jiao Tong University (SJTU) Yum Source
32-bit: rpm -- import http://ftp.sjtu.edu.cn/centos/5/ OS /i386/RPM-GPG-KEY-CentOS-5
64-bit: rpm -- import http://ftp.sjtu.edu.cn/centos/5/ OS /x86_64/RPM-GPG-KEY-CentOS-5
Step 2
Yum update