Linux CentOs6.5誤卸載自帶python和yum後的解決辦法

1:卸載python

#rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps #強制刪除已安裝程序及其關聯

#whereis python|xargs rm -frv #刪除所有殘餘文件 #xargs,允許你對輸出執行其他某些命令

#whereis python

2 : 卸載yum

#rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps

#whereis yum|xargs rm -frv

#whereis yum

3 : 安裝python和yum

從http://mirrors.163.com/centos/6/os/i386/Packages/下載並安裝python和yum程序包及其依賴包

python: wget http://mirrors.163.com/centos/6/os/i386/Packages/軟件對應版本

a. python

b. python-libs

c. python-iniparse

d. python-pycurl

e. python-urlgrabber

f. rpm-python

#rpm -ivh python-* rpm-python-*  --force --nodeps

yum: wget http://mirrors.163.com/centos/6/os/i386/Packages/軟件對應版本

a. yum

b. yum-metadata

c. yum-plugin-fastestmirror

#rpm -ivh yum-* --force --nodeps

###經測試可以安裝成功###

下一步配置yum源

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章