1
2
3
4
5
6
7
8
|
1、查看已安装python的版本,可能是当前系统存在多个python导致
[root@
test
~]
# whereis python
python:
/usr/bin/python2
.6
/usr/bin/python
.6-config
/usr/lib/python2
/usr/lib64/python2
/usr/include/python2
/usr/share/man/man1/python
.1.gz
# vi /usr/bin/yum
将
#!/usr/bin/python 修改为 #!/usr/bin/python2.6
rm
-rf
/usr/bin/python
ln
-s
/usr/bin/python
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ##强制删除已安装程序及其关联
# whereis python ##验证删除,返回无结果
2、删除现有的yum
# rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps
# whereis yum |xargs rm -frv
3、从http:
//mirrors
.ustc.edu.cn
/centos/6
.4
/os/x86_64/Packages/
下载相应的包
python-2.6.6-36.el6.x86_64.rpm
python-devel-2.6.6-36.el6.x86_64.rpm
python-libs-2.6.6-36.el6.x86_64.rpm
python-pycurl-7.19.0-8.el6.x86_64.rpm
python-setuptools-0.6.10-3.el6.noarch.rpm
python-urlgrabber-3.9.1-8.el6.noarch.rpm
python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm-python-4.8.0-32.el6.x86_64.rpm
yum-3.2.29-40.el6.centos.noarch.rpm
yum-Metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-utils-1.1.30-14.el6.noarch.rpm
yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
yum-plugin-protectbase-1.1.30-14.el6.noarch.rpm
yum-plugin-aliases-1.1.30-14.el6.noarch.rpm
yum-plugin-downloadonly-1.1.30-14.el6.noarch.rpm
由于源中版本会更新,具体请查看URL中的版本再下载下来!
# rpm -Uvh --replacepkgs python*.rpm
# rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm
可能之间还需要zlib和zlib-devel包,根据情况下载并安装!