Centos6.9重装python2.6和yum

本人手贱,卸载了centos6.9系统自带的python2.6,导致yum是用不了了,索性卸载干净重新安装。

安装python

创建python的安装目录:

mkdir /usr/local/src/python

下载安装文件:

wget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-2.6.6-66.el6_8.x86_64.rpm

wget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

wget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-pycurl-7.19.0-9.el6.x86_64.rpm

wget  http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-devel-2.6.6-66.el6_8.x86_64.rpm

wget  http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-libs-2.6.6-66.el6_8.x86_64.rpm

wget  http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

wget  http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/rpm-python-4.8.0-59.el6.x86_64.rpm

切换到/usr/local/src/python路径下,执行

rpm -ivh python-*   rpm-python-*

安装yum

创建yum的安装目录: 

mkdir /usr/local/src/yum

下载安装文件:

wget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm


wget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm


wget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm

切换到/usr/local/src/yum路径下,执行

rpm -ivh yum-*

如果在下载安装包的过程中报这样的错误:

 则需要切换镜像源的地址,目前我的下载源地址已经切换过了,是可用的。

最后用python和yum测试一下是否安装完成即可。

你可能感兴趣的:(linux)