Since the Yum online update for Rhel is chargeable, it cannot be used if not registered, that is, the software cannot be installed online. In this case, if the machine we are using is a rhel system, it will be cumbersome to mount the local CD-ROM each time the software is installed, and some of the software is old, in which case we can use the CentOS yum source to meet our needs.
First, delete the original Rhel yum
Rpm-aq|grep Yum|xargs rpm-e--nodeps
Ii. Download the Yum installation package for CentOS (163 source)
wget Http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpmwget/HTTP Mirrors.163.com/centos/5/os/x86_64/centos/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpmwget/HTTP mirrors.163.com/centos/5/os/x86_64/centos/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm wget http://mirrors.163.com /centos/5/os/x86_64/rpm-gpg-key-centos-5
Installation of the Yum installation package for CentOS
Yum and yum-plugin-fastestmirror need to be installed together, the two packages exist dependencies, the separate installation will fail, before installing the Rpm-gpg-key into the system, otherwise there will be a warning message
RPM-IVH yum-metadata-parser-1.1.2-4.el5.x86_64.rpm rpm--import RPM-GPG-KEY-CENTOS-5RPM–IVH yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rm
So we can use Yum online.
Iv. Modifying the Yum source
To use Yum to install the software online faster, we can use the domestic netease yum source or other domestic yum source
V. Change the Yum source #我们使用网易的CentOS镜像源
Cd /etc/yum.repos.d/vi rhel-debuginfo.repo# 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 are updated to and# geographically close to the client. you should use this for centos updates# unless you are manually Picking other mirrors.## if the mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.##[base]name=centos-5 - base - 163.commirrorlist= Http://mirrorlist.centos.org/?release=5&arch= $basearch &repo=osbaseurl=http://mirrors.163.com/centos/5/ os/$basearch/gpgcheck=1gpgkey=fIle:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5#released updates[updates]name=centos-5 - updates - 163.commirrorlist=http://mirrorlist.centos.org/?release=5&arch= $basearch &repo= updatesbaseurl=http://mirrors.163.com/centos/5/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/ rpm-gpg-key-centos-5#packages used/produced in the build but not released[ Addons]name=centos-5 - addons - 163.commirrorlist=http://mirrorlist.centos.org/?release=5 &arch= $basearch &repo=addonsbaseurl=http://mirrors.163.com/centos/5/addons/$basearch/gpgcheck=1gpgkey= file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5#additional packages that may be useful[ Extras]name=centos-5 - extras - 163.commirrorlist=http://mirrorlist.centos.org/?release=5 &arch= $basearch &repo=extrasbaseurl=http://mirrors.163.com/centos/5/extras/$basearch/gpgcheck=1gpgkey= File:///etc/pki/rpm-gpg/RPM-GPG-KEy-centos-5#additional packages that extend functionality of existing packages[centosplus]name=centos-5 - plus - 163.commirrorlist=http://mirrorlist.centos.org/ ? release=5&arch= $basearch &repo=centosplusbaseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/ Gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5#contrib - packages by centos users[contrib]name=centos-5 - contrib - 163.commirrorlist=http:// Mirrorlist.centos.org/?release=5&arch= $basearch &repo=contribbaseurl=http://mirrors.163.com/centos/5/ contrib/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5
Vi. Cleaning up
Yum Clean Allyum Makecache
Vii. Update
Yum Update
Blog post reference: http://pvbutler.blog.51cto.com/7662323/1320908
Rhel5u8 Configuring the CentOS Yum Source