解决Centos5上升级Python后yum不能用的问题

把Centos5上的Python升级到2.6后,用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 packagewhich 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.6.5 (r265:79063, Jul  22010, 16:30:56)[GCC 4.1.2 20080704(Red Hat 4.1.2-46)]If you cannot solve this problem yourself, please go to
the yum faq at:
 http://wiki.linux.duke.edu/YumFaq

解决方法:
由于yum 默认用的是python2.4,所以编译vim /usr/bin/yum

把#!/usr/bin/python 改为
#!/usr/bin/python2.4 即可

本日志由 flyinweb 于 2011-09-27 17:28:49 发表到 Linux 中,目前已经被浏览 613 次,评论 0 次;

作者添加了以下标签: yumNo module named yum