1. Uninstall the original yum source
rpm -qa | grep yum | xargs rpm -e --nodeps
rpm -qa | grep python-urlgrabber | xargs rpm -e --nodeps
2. Download the yum source installation package
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-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
4. Install yum source
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
5. Back up the original yum source configuration
cd /etc/yum.repos.d/
cp rhel-source.repo rhel-source.repo_back
6. Obtain the centos6 yum source configuration file
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
7. Edit the yum source configuration file of centos6, modify $ releaserver in baseurl to 6, there are five places
vim CentOS6-Base-163.repo
[After modification]
8. Clean the cache
yum clean all
yum makecache
9. Finish