1. 删除RHEL預設yum # rpm -qa | grep yum yum-metadata-parser-1.1.2-16.el6.i686
PackageKit-yum-0.5.8-21.el6.i686
yum-3.2.29-40.el6.noarch
yum-rhn-plugin-0.9.1-43.el6.noarch
yum-plugin-security-1.1.30-14.el6.noarch
yum-utils-1.1.30-14.el6.noarch
PackageKit-yum-plugin-0.5.8-21.el6.i686
# rpm -e *yum* --nodeps // 如果無法成功删除則分别手動删除
2. 下載下傳并安裝CentOS的yum # cd ~/Downloads # wget http://mirrors.sohu.com/centos/6.4/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm # wget http://mirrors.sohu.com/centos/6.4/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm # wget http://mirrors.sohu.com/centos/6.4/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm # wget http://mirrors.sohu.com/centos/6.4/os/i386/Packages/yum-plugin-security-1.1.30-14.el6.noarch.rpm # wget http://mirrors.sohu.com/centos/6.4/os/i386/Packages/yum-utils-1.1.30-14.el6.noarch.rpm # wget http://mirrors.sohu.com/centos/6.4/os/i386/Packages/PackageKit-yum-0.5.8-21.el6.i686.rpm # wget http://mirrors.sohu.com/centos/6.4/os/i386/Packages/PackageKit-yum-plugin-0.5.8-21.el6.i686.rpm # rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.i686.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm yum-plugin-security-1.1.30-14.el6.noarch.rpm yum-utils-1.1.30-14.el6.noarch.rpm # rpm -ivh PackageKit-yum-0.5.8-21.el6.i686.rpm PackageKit-yum-plugin-0.5.8-21.el6.i686.rpm
3. 添加鏡像配置 # vi /etc/yum.repos.d/rhel-debuginfo.repo 輸入如下内容: [base]
name=Red Hat Enterprise Linux $releasever -Base
baseurl=http://mirrors.sohu.com/centos/6.4/os/$basearch/ gpgcheck=1
[update]
name=Red Hat Enterprise Linux $releasever -Updates
baseurl=http://mirrors.sohu.com/centos/6.4/updates/$basearch/ gpgcheck=1
[extras]
name=Red Hat Enterprise Linux $releasever -Extras
baseurl=http://mirrors.sohu.com/centos/6.4/extras/$basearch/ gpgcheck=1
4. 下載下傳并導入KEY # cd /etc/pki/rpm-gpg/ # wget http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6 # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
參考資料 http://www.2cto.com/os/201101/81306.html