1. View the Radhat version number of the current operating system and the 32/64-bit operating system.
[Email protected] centos5]# more/etc/redhat-release Red Hat Enterprise Linux Server release 5.8 (tikanga) [Email Protect Ed] centos5]# uname-alinux localhost.localdomain 2.6.18-308.el5 #1 SMP Fri Jan 17:17:51 EST. x86_64 x86_64 x86_64 Gnu/linux
2. Delete Radhat's own yum service
[Email protected] centos5]# rpm-qa|grep yum |xargs rpm-e--nodeps
3. Download the appropriate Yum installation package and install it (the number of installation packages varies depending on the operating system version number)
[Email protected] centos5]# wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/ Yum-3.2.22-40.el5.centos.noarch.rpm[[email protected] centos5]# wget http://mirrors.163.com/centos/5/os/x86_64/ Centos/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm[[email protected] centos5]# wget http://mirrors.163.com/ centos/5/os/x86_64/centos/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm [[email protected] centos5]# RPM-IVH yum* . rpm
4. Configure the Yum source (163 image is recommended)
[Email protected] centos5]# Vi/etc/yum.repos.d/cenos-base.repo
Add the following content:
# 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 is updated to and# geographically close to the client. You should use this for CentOS updates# unless is manually picking other mirrors.## If the mirrorlist= does For your, as a fall back you can try the # remarked out Baseurl= line instead.##[base]name=centos-$releasever-base#mirror list=http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=osbaseurl=http:// mirrors.163.com/centos/5/os/x86_64/gpgcheck=1gpgkey=http://mirrors.163.com/centos/5/os/x86_64/ rpm-gpg-key-centos-5#released updates [updates]name=centos-$releasever-updates#mirrorlist=http:// mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=updatesbaseurl=http://mirrors.163.com/ centos/5/updates/x86_64/gpgcheck=1gpgkey=http://mirrors.163.com/centos/5/os/x86_64/rpm-gpg-key-centos-5# Additional packages that could be useful[extras]name=centos-$releasever-extras#mirrorlist=http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=extrasbaseurl=http://mirrors.163.com/centos/5/extras/x86_64/gpgcheck=1gpgkey=http://mirrors.163.com/ Centos/5/os/x86_64/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=centosplusbaseurl=http://mirrors.163.com/centos/5/centosplus/x86_64/gpgcheck=1enabled=0gpgkey=http:/ /mirrors.163.com/centos/5/os/x86_64/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= Contribbaseurl=http://mirrors.163.com/centos/5/contrib/x86_64/gpgcheck=1enabled=0gpgkey=http://mirrors.163.com /centos/5/os/x86_64/rpm-gpg-key-centos-5
5. Clear the cache and download the new mirrored cache
[email protected] centos5]# yum clean all[[email protected] centos5]# yum Makecache
6. Test (view current Subversion version and check server Subversion version)
[[email protected] yum.repos.d]# rpm-qa|grep subversionsubversion-1.6.11-7.el5_6.4subversion-1.6.11-7.el5_ 6.4 [[email protected] yum.repos.d]# yum check-update subversionloaded plugins:fastestmirror, Katello, product-i D, subscription-managerupdating certificate-based repositories. Unable to read consumer identityloading mirror speeds from cached hostfilesubversion.i386 1.6.11-12.el5_10 Base subversion.x86_64 1.6.11-12.el5_10 Base obsoleting P Ackagescentos-release.x86_64 10:5-11.el5.centos Base Red Hat-release.x86_64 5server-5.8.0.3 Installedfirefox.i386 31.3.0-4.el5.centos Updates firefox.i386 3.6.26-1.el5_7 installedfirefox.x86_64 31.3.0-4.el5.centos Updates firefox.x86_64 3.6.26-1.el5_7 installed
7. Installation of Yum notes
Install the appropriate CentOS according to the Linux version number and refer to the Cenos-base.repo file corresponding to the CentOS version number,
(1), if the installation of CentOS 5 Yun, but reference CentOS6 source Yum Makecache will be an error.
(2), if the operating system is Radhat 5, but installing CentOS6 yum will cause the installation to require manual installation and upgrade of a large number of dependent packages.
8. Attached: centos China mirror URL
Asiachina Zhejiang Universityhttp://mirrors.zju.edu.cn/centos/asiachinaalibaba Cloud Computinghttp:// Mirrors.aliyun.com/centos/asiachinabeijing Institute of technologyhttp://mirror.bit.edu.cn/centos/ Asiachinabitcomm Ltd.http://mirrors.pubyun.com/centos/asiachinacds chinahttp://mirrors.yun-idc.com/centos/ftp:// Mirrors.yun-idc.com/centos/rsync://mirrors.yun-idc.com/centos/asiachinachina University of Geoscienceshttp:// Mirrors.cug.edu.cn/centos/asiachinadalian Neusoft University of informationhttp://mirrors.neusoft.edu.cn/centos/ Ftp://mirrors.neusoft.edu.cn/centos/AsiaChinaHuazhong University of Science and technologyhttp:// mirrors.hust.edu.cn/centos/rsync://mirrors.hust.edu.cn/centos/asiachinaneteasehttp://mirrors.163.com/centos/ Asiachinanortheastern University, Shenyang Liaonihttp://mirror.neu.edu.cn/centos/asiachinanorthwest A&F Universityhttp://mirrors.nwsuaf.edu.cn/centos/asiachinaqiming College of Huazhong University of Science and technologyhttp://mirrors.hustunique.com/centos/Rsync://mirrors.hustunique.com/centos/asiachinashanghai Jiao Tong universityhttp://ftp.sjtu.edu.cn/centos/ftp:// Ftp.sjtu.edu.cn/centos/asiachinasohu INC, Beijing P.R. Chinahttp://mirrors.sohu.com/centos/asiachinauniversity of Science and Tech of Chinahttp://centos.ustc.edu.cn/centos/asiachina-hong Kongasia Web Services ltd.http:// mirror.vpshosting.com.hk/pub/linux/centos/ftp://mirror.vpshosting.com.hk/pub/linux/centos/
Radhat 5 Configuration Yum