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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7卸载python7.2和yum及安装python7.2和yum相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Centos7Yum安装配置指定版本nginx及卸载Centos7Yum安装的nginx

Centos7卸载nginx及phpphp-fpm方法

CentOS7卸载及安装Nginx

centos7彻底卸载mysql和通过yum安装mysql

centos7 怎么卸载软件php

centos7怎样用命令卸载