centos 升级系统python 导致yum命令不能用解决办法

升级完成后 将系统的python路径给覆盖了 

然后用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.7.3 (default, Dec 20 2014, 03:32:39)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq

 

解决办法:

sudo vi /usr/bin/yum
编辑文件:
一般在文件的最头部
修改python的路径我使用的是centos6.5 将路径修改成了如下,
#/usr/local/bin/python2.6

然后就可以正常使用yum 来安装软件了

然来liunx的yum 也是要python来配合的 看来系统的python 还是不能随便升级的啊



posted @ 2014-12-22 15:01  assassin0905  阅读(210)  评论(0)    收藏  举报