Redhat default does not support the third-party Yum Source, requires a portal account, the following rhel5 and rhel6 to the CentOS source
First, rhel5.5 x86_64 to CentOS's Yum source
View the system's own Yum-related RPM packages
Rpm-qa|grep Yum
Delete the system's own Yum-related packages
Rpm-e--nodeps yum-updatesd-0rpm-e--nodeps yum-security rpm-e--nodeps yum-metadata-prpm-e--nodeps yum-rhn-plugin
Install 163yum packages, three Yum packages have dependencies and need to be installed together
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm wget/http Mirrors.163.com/centos/5/os/x86_64/centos/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpmwget wget RPM-IVH PYT hon-iniparse-0.2.3-6.el5.noarch.rpm RPM-IVH yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm yum-3.2.22-40.el5.centos.noarch.rpm yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
Rename the original repo file under/ETC/YUM.REPOS.D and create a new Base.repo
[base]name=red hat enterprise linux $releasever - basebaseurl=http:// mirror.centos.org/centos/5/os/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5 #released updates[updates]name=Red Hat Enterprise Linux $releasever - updatesbaseurl=http://mirror.centos.org/centos/5/updates/$basearch/gpgcheck=1gpgkey=http:// mirror.centos.org/centos/rpm-gpg-key-centos-5 #packages used/produced in the build but not released[addons]name=Red Hat Enterprise Linux $releasever - addonsbaseurl=http://mirror.centos.org/centos/5/addons/$basearch/pgcheck=1gpgkey=http:// mirror.centos.org/centos/rpm-gpg-key-centos-5 #additional packages that may be useful[extras]name=red hat enterprise linux $releasever - extrasbaseurl=http:// mirror.centos.org/centos/5/extras/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5 #additional packages that extend Functionality of existing packages[centosplus]name=red hat enterprise linux $releasever - plusbaseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/gpgcheck= 1enabled=0gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-5 #contrib - packages by centos users[contrib]name=red hat enterprise linux $releasever - contribbaseurl=http://mirror.centos.org/centos/5/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http:// Mirror.centos.org/centos/rpm-gpg-key-centos-5
You can also use mirrors.163.com or mirrors.aliyun.com's yum source, rhel6 the 163yum source as an example, and import the key
RPM--import http://mirror.centos.org/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
Generate cache
Yum Clean Allyum Makecache
If the configuration succeeds, it will prompt the load to succeed
Second, redhat6.4 x86_64 to CentOS's Yum source
Delete the original Yum-related RPM package
Rpm-qa|grep Yum rpm-e--nodeps yum-rhn-plugin rpm-e--nodeps yum-metadata-parser rpm-e--nodeps yum-utils rpm-e--nod EPS yum-plugin-security rpm-e--nodeps rhn-check
Download the installation package and install
Mkdir-p/server/tools Cd/server/tools/wget http://mirrors.163.com/centos/6/os/x86_64/Packages/ python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/ yum-3.2.29-69.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/ yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/ yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm RPM-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm RPM-IVH yum-3.2.29-69.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
Rename the original repo file and download the 163 repo file
CD/ETC/YUM.REPOS.D/MV Rhel-source.repo Rhel-source.repo.bak wget http://mirrors.163.com/.help/ Centos6-base-163.repo rpm--import http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6 sed-i ' s#$ Releasever#6#g ' Centos6-base-163.repo
Empty the cache and regenerate
Yum Clean all yum Makecache
If you configure the Yum source for Ali, you can add the following command
Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-6.repo
This rhel6 configuration of the CentOS source configuration is complete
Redhat Configuring the Yum source for CentOS