码迷,mamicode.com
首页 > 其他好文 > 详细

yum 无法使用

时间:2016-04-21 15:15:20      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

[root@zabbix yum.repos.d]# yum update
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.

Its possible that the above module doesnt match the
current version of Python, which is:
2.7.2 (default, Apr 11 2016, 10:35:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]

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

YUM 是基于python 写的,错误是由于yum 调用了高版本的PYTHON
查看yum版本

[root@zabbix yum.repos.d]# rpm -qa |grep yum
yum-3.2.29-69.el6.centos.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-3.2.29-40.el6.centos.noarch
yum-plugin-fastestmirror-1.1.30-30.el6.noarch
yum-plugin-fastestmirror-1.1.30-14.el6.noarch

 

查看python版本

[root@zabbix yum.repos.d]# whereis python
python: /usr/bin/python /usr/bin/python2.6 /usr/bin/python2.6-config /usr/bin/python2.7 /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python.1.gz

 有2.6与2.7两个版本

#which yum

/usr/bin/yum

#vim /usr/bin/yum

   #!/usr/bin/python2.6

保存关闭

#yum update 

此时可以正常使用

 

yum 无法使用

标签:

原文地址:http://www.cnblogs.com/xfbc/p/5416776.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!