Python升级Yum不能使用解决

 

1、系统版本

[root@vm10-254-206-95 ~]# cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m

 

2、系统默认python版本

[root@vm10-254-206-95 ~]# python -V
Python 2.6.6

 

3、报错信息

[root@vm10-254-206-95 ~]# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
   No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.5.4 (r254:67916, Feb 24 2010, 10:03:49)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
If you cannot solve this problem yourself, please go to
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq
View Code

解决方法:

[root@vm10-254-206-95 ~]# which yum
/usr/bin/yum

[root@vm10-254-206-95 ~]# vi /usr/bin/yum
#!/usr/bin/python
改为:
#!/usr/bin/python2.6
然后保存OK.

 

posted @ 2016-05-12 21:35  每天进步一点点!!!  阅读(658)  评论(0编辑  收藏  举报