1.卸载redhat自带的yum组件



 



rpm -qa|grep yum|xargs rpm -e --nodeps



 



 



2.安装centos的yum包



 



32位



 



# wget  http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.centos.i386.rpm



 



# wget  http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm



 



# wget  http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm



 



 



 



64位



 



# wget  http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.centos.x86_64.rpm



 



# wget  http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm



 



# wget  http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm



 



 



 



3. 下载更新源,并存放在系统目录中 



 



wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo



 



mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo



 



4. 更新yum 资源库



yum makecache