1. Check the current Linux operating system RedHat version and 32/64-bit operating system. [Root @ localhostCentOS5] # more/etc/redhat-releaseRedHatEnterpriseLinuxServerrelease5.8 (Tikanga) [root @ localhostcentos5] # uname-aLinuxlocalhost.locald
1. Check the current Linux operating system RedHat version and 32/64-bit operating system.
[Root @ localhost CentOS5] # more/etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
[Root @ localhost centos5] # uname-
Linux localhost. localdomain 2.6.18-308. el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
2. Delete the yum service that comes with RedHat.
[Root @ localhost centos5] # rpm-qa | grep yum | xargs rpm-e -- nodeps
3. download and install the corresponding yum installation package (the number of installation packages varies depending on the operating system version)
[Root @ localhost centos5] # wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
[Root @ localhost centos5] # wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
[Root @ localhost centos5] # wget http://mirrors.163.com/centos/5/ OS /x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
[Root @ localhost centos5] # rpm-ivh yum *. rpm
4. Configure the yum source (163 images are recommended)
[Root @ localhost 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
# Update status of each mirror to pick mirrors that are updated to and
# Geographically close to the client. You shoshould use this for CentOS updates
# Unless you are manually picking other mirrors.
#
# If the specified list = does not work for you, as a fall back you can try
# Remarked out baseurl = line instead.
#
#
[Base]
Name = CentOS-$ releasever-Base
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
Base url = http://mirrors.163.com/centos/5/ OS /x86_64/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/5/ OS /x86_64/RPM-GPG-KEY-CentOS-5
# Released updates
[Updates]
Name = CentOS-$ releasever-Updates
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
Base url = http://mirrors.163.com/centos/5/updates/x86_64/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/5/ OS /x86_64/RPM-GPG-KEY-CentOS-5
# Additional packages that may be useful
[Extras]
Name = CentOS-$ releasever-Extras
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
Base url = http://mirrors.163.com/centos/5/extras/x86_64/
Gpgcheck = 1
Gpgkey = 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
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
Base url = http://mirrors.163.com/centos/5/centosplus/x86_64/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirrors.163.com/centos/5/ OS /x86_64/RPM-GPG-KEY-CentOS-5
# Contrib-packages by Centos Users
[Contrib]
Name = CentOS-$ releasever-Contrib
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib
Base url = http://mirrors.163.com/centos/5/contrib/x86_64/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirrors.163.com/centos/5/ OS /x86_64/RPM-GPG-KEY-CentOS-5
5. Clear the cache and download the new image cache.
[Root @ localhost centos5] # yum clean all
[Root @ localhost centos5] # yum makecache
6. Test (view the current subversion version and check the server subversion Version)
[Root @ localhost yum. repos. d] # rpm-qa | grep subversion
Subversion-1.6.11-7.el5_6.4
Subversion-1.6.11-7.el5_6.4 [root @ localhost yum. repos. d] # yum check-update subversion
Loaded plugins: fastestmirror, katello, product-id, subrole-manager
Updating certificate-based repositories.
Unable to read consumer identity
Loading mirror speeds from cached hostfile
Subversion. i386 1.6.11-12. el5_10 base
Subversion. x86_64 1.6.11-12. el5_10 base
Obsoleting Packages
Centos-release.x86_64 10: 5-11. el5.centos base
Redhat-release.x86_64 5Server-5.8.0.3 installed
Firefox. i386 31.3.0-4. el5.centos updates
Firefox. i386 3.6.26-1. el5_7 installed
Firefox. x86_64 31.3.0-4. el5.centos updates
Firefox. x86_64 3.6.26-1. el5_7 installed
7. Precautions for installing yum
Install the corresponding CentOS according to the Linux version number and reference the CenOS-Base.repo file corresponding to the CentOS version number,
(1) If the yun of CentOS 5 is installed but the source yum makecache of CentOS6 is referenced, an error is reported.
(2) If the operating system is RedHat 5, but CentOS6 yum is installed, a large number of dependent packages need to be manually installed and upgraded during installation.
8. Attachment: CentOS China image website
Asia China Zhejiang University Co., http://mirrors.zju.edu.cn/centos/.
Asia China Alibaba Cloud Computing http://mirrors.aliyun.com/centos/
Asia China Beijing Institute of Technology http://mirror.bit.edu.cn/centos/
Asia China BitComm Ltd. http://mirrors.pubyun.com/centos/
Asia China CDS China http://mirrors.yun-idc.com/centos/ ftp://mirrors.yun-idc.com/centos/ rsync: // mirrors.yun-idc.com/centos/
Asia China University of Geosciences http://mirrors.cug.edu.cn/centos/
Asia China Dalian Neusoft University of Information http://mirrors.neusoft.edu.cn/centos/ Co., ftp://mirrors.neusoft.edu.cn/centos/.
Asia China Huazhong University of Science and Technology http://mirrors.hust.edu.cn/centos/ rsync: // mirrors.hust.edu.cn/centos/
Asia China NetEase http://mirrors.163.com/centos/
Asia China Northeastern University, Shenyang Liaoni http://mirror.neu.edu.cn/centos/
Asia China Northwest A & F University http://mirrors.nwsuaf.edu.cn/centos/
Asia China Qiming College of Huazhong University of Science and Technology Co., http://mirrors.hustunique.com/centos/. rsync: // mirrors.hustunique.com/centos/
Asia China Shanghai Jiao Tong University Co., http://ftp.sjtu.edu.cn/centos/.
Asia China Sohu Inc, Beijing P. R. China http://mirrors.sohu.com/centos/
Asia China University of Science and Tech of China http://centos.ustc.edu.cn/centos/
Asia China-Hong Kong Asia Web Services Ltd. http://mirror.vpshosting.com.hk/pub/linux/centos/ ftp://mirror.vpshosting.com.hk/pub/linux/centos/
Setup http://www.linuxidc.com/Linux/2015-01/111266.htm for using a DVD as the default yum source in CentOS
RedHat 6.2 Linux modify yum source free use CentOS source http://www.linuxidc.com/Linux/2013-07/87383.htm
Configure epel yum source http://www.linuxidc.com/Linux/2012-10/71850.htm
Redhat local yum source configuration http://www.linuxidc.com/Linux/2012-11/75127.htm
Yum profile description http://www.linuxidc.com/Linux/2013-04/83298.htm
Install yum http://www.linuxidc.com/Linux/2013-06/86535.htm in RedHat 6.1
YUM installation and cleaning http://www.linuxidc.com/Linux/2013-07/87163.htm
Build yum local ground source http://www.linuxidc.com/Linux/2014-07/104533.htm on CentOS 6.4
For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-01/111285.htm