yum命令无法使用的问题

今天需要装一个分析nginx日志的轻量级工具goaccess,需要安装一些依赖包,缺发现无法安装。

报如下错误:

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

google了一下,原来是python升级导致的问题。

[root@AY1304112326042147fa ~]# rpm -qa |grep yum
yum-3.2.29-40.el6.centos.noarch
yum-plugin-downloadonly-1.1.30-14.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-plugin-fastestmirror-1.1.30-10.el6.noarch
[root@AY1304112326042147fa ~]# whereis python
python: /usr/bin/python2.6 /usr/bin/python /usr/bin/python2.6-config /usr/bin/python.bak /usr/bin/python2.7 /usr/lib/python2.6 /usr/lib/python2.7 /usr/lib64/python2.6 /usr/local/bin/python2.7 /usr/local/bin/python2.7-config /usr/local/bin/python /usr/local/lib/python2.7 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
[root@AY1304112326042147fa ~]# python
Python 2.7.3 (default, Jul 15 2013, 17:08:12) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
[root@AY1304112326042147fa ~]# which yum 
/usr/bin/yum
[root@AY1304112326042147fa ~]# vim /usr/bin/yum 
[root@AY1304112326042147fa ~]# vi /usr/bin/yum-updatest


#!/usr/bin/python
改为:
#!/usr/bin/python2.6

你可能感兴趣的:(linux,python,yum)