重装python2.7+yum
Posted 东篱南山
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了重装python2.7+yum相关的知识,希望对你有一定的参考价值。
巨坑慎入:
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-2.7.5-68.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-devel-2.7.5-68.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-libs-2.7.5-68.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/iniparser-3.1-5.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/rpm-python-4.11.3-32.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-plugin-protectbase-1.1.31-45.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-plugin-aliases-1.1.31-45.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-backports-1.0-8.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-ipaddress-1.0.16-2.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-chardet-2.2.1-1.el7_1.noarch.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
rpm -Uvh --replacepkgs python*.rpm
rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm
sudo vim /usr/bin/yum
把文件头部的#!/usr/bin/python改成#!/usr/bin/python2.7保存退出即可.
/usr/libexec/urlgrabber-ext-down
看看,发下他也使用了/usr/bin/python
,于是跟前面一样,改为2.7,完成。
以上是关于重装python2.7+yum的主要内容,如果未能解决你的问题,请参考以下文章
centos7升级python2.7后导致yum无法使用,按照网上的说法配置了/bin/yum的第
yum报错-bash: /usr/bin/yum: /usr/bin/python2.7: bad
CentOS6.8 安装python2.7,pip以及yum