centos 卸載python和yum之后的解決辦法網(wǎng)上看到有同學(xué)yum不能使用的消息,,出現(xiàn)了下面的結(jié)果
無賴的使用了網(wǎng)上的很多方法,,還是不行,。 于是我卸載了python和yum,,覺得自己重新安裝python和yum,。 步驟1:卸載python rpm -qa|grep python|xargs rpm -e --allmatches --nodeps whereis python|xargs rm -fr 步驟2:卸載yum rpm -qa|grep yum|xargs rpm -e --allmatches --nodeps rm -rf /etc/yum.repos.d/* whereis yum|xargs rm -fr 步驟3:安裝python 在任何一個(gè)鏡像站中找到你系統(tǒng)對(duì)應(yīng)版本的python rpm包(我的是centos 6.9的64位系統(tǒng),,使用的鏡像是http://mirrors.163.com/centos/6.9/os/x86_64/Packages/) mkdir /usr/local/src/python wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-2.6.6-66.el6_8.x86_64.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-pycurl-7.19.0-9.el6.x86_64.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-devel-2.6.6-66.el6_8.x86_64.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-libs-2.6.6-66.el6_8.x86_64.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/rpm-python-4.8.0-55.el6.x86_64.rpm
切換到/usr/local/src/python路徑下 rpm -ivh python-* rpm-python-* 如果中間過程出現(xiàn)了類似下面的代碼,,這是包與包之間的依賴關(guān)系,,只需要卸載已經(jīng)安裝的包(rpm -e 包名(沒有.rpm后綴)),,然后先安裝依賴包 如: rpm -e yum-metadata-parser-1.1.2-16.el6.x86_64 rpm -ivh /yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 步驟4:安裝yum mkdir /usr/local/src/yum wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm 切換到/usr/local/src/python路徑下 rpm -ivh yum-* 步驟5:測(cè)試 運(yùn)行 yum (成功)
|
|