CentOS6.3下修復yum安裝工具
一.刪除自帶的yum
# rpm -aq|grep yum|xargs rpm -e --nodeps
二.從CentOS系統映象中提取rpm包,這裡以centos6.3_x64為例
這裡從映象包Packages目錄下提取如下rpm包:
三.安裝rpm包
注:這裡我為了方便就將所有提取出來的包放到我的VPS上供大家下載
# 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 yum-3.2.29-30.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
注:這一步要兩個一起安裝,要不會會出現如下錯誤:
----------------------------------------------
# rpm -ivh yum-3.2.29-30.el6.centos.noarch.rpm
warning: yum-3.2.29-30.el6.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
yum-fastestmirror is needed by yum-3.2.29-30.el6.centos.noarch
# rpm -ivh yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
warning: yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
yum >= 3.0 is needed by yum-plugin-fastestmirror-1.1.30-14.el6.noarch
-----------------------------------------------
# rpm -ivh PackageKit-yum-0.5.8-20.el6.x86_64.rpm
# rpm -ivh PackageKit-yum-plugin-0.5.8-20.el6.x86_64.rpm
四.下載配置源:
# cd /etc/yum.repos.d/
五.測試
# yum version
---------------------------------------------
Loaded plugins: fastestmirror, refresh-packagekit
Warning: RPMDB altered outside of yum.
Installed: 6/x86_64 1285:a2a18f0b8c3ca036a361579f6b22014aadfd680e
Group-Installed: yum 14:45bb88c01e2346ba8fe7ac401a053cfd42bda739
version
----------------------------------------------
大功告成.....