码迷,mamicode.com
首页 > 编程语言 > 详细

centos7卸载python7.2和yum及安装python7.2和yum

时间:2020-04-30 17:38:24      阅读:93      评论:0      收藏:0      [点我收藏+]

标签:ada   成功   test   xargs   x86   --nodeps   卸载   ges   rm -rf   

1、强制删除已安装python和yum及其关联

rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps
whereis python |xargs rm -frv
whereis python ##验证删除,返回无结果
删除YUM
rpm -qa|grep yum|xargs rpm -e --allmatches --nodeps
rm -rf /etc/yum.repos.d/*
whereis yum|xargs rm -fr

2、使用wget分别下载python以及yum的rpm包(注意:一定要和系统的版本号对应)

wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-2.7.5-34.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-pycurl-7.19.0-17.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-devel-2.7.5-34.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-libs-2.7.5-34.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/python-urlgrabber-3.10-7.el7.noarch.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/rpm-python-4.11.3-17.el7.x86_64.rpm

wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm

3、安装python以及yum的rpm包

rpm -ivh python- rpm-python- --nodeps --force
rpm -ivh yum-*

4、验证

python -V
yum

至此yum重新安装成功!

centos7卸载python7.2和yum及安装python7.2和yum

标签:ada   成功   test   xargs   x86   --nodeps   卸载   ges   rm -rf   

原文地址:https://blog.51cto.com/12226796/2491883

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!