1.干掉rhn,yum
rpm -qa |grep rhn #除了rhnlib其他全rpm -e --nodeps掉
rpm -qa |grep rpm #全部rpm -e --nodeps掉

2.重新安装yum
wget http://mirrors.163.com/centos/5.6/os/i386/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5.6/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
wget http://mirrors.163.com/centos/5.6/os/i386/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
rpm -ivh *.rpm


3.更换源  备份原来的配置文件
虚拟机,果断清空rh源
rm /etc/yum.repos.d/*
wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
mv CentOS5-Base-163.repo /etc/yum.repos.d/
vim /etc/yum.repos.d/CenOS5-Base-163.repo
:1,$s/$releasever/5.6/g


4.更新源
yum makecache