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

yum

时间:2015-05-07 12:39:26      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:yum

错误信息如下:

[root@bjzw-mcu01-x86p-app01 ~]# yum -y 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.

It‘s possible that the above module doesn‘t match the
current version of Python, which is:
2.7.3 (default, Jul  8 2014, 22:55:29)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]

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

 

排错思路:

1.查看yum的版本号

[root@bjzw-mcu01-x86p-app01 ~]# rpm -qa | grep yum
yum-3.2.29-60.el6.centos.noarch
yum-plugin-fastestmirror-1.1.30-30.el6.noarch
yum-utils-1.1.30-30.el6.noarch
yum-plugin-security-1.1.30-30.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64

 

2.查看python的版本号,发现有2种版本号

[root@bjzw-mcu01-x86p-app01 ~]# whereis python
python: /usr/bin/python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/local/python2.7 /usr/share/man/man1/python.1.gz

 

3. 查看当前所使用的版本

[root@bjzw-mcu01-x86p-app01 ~]# python
Python 2.7.3 (default, Jul  8 2014, 22:55:29)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

 

4.修改yum命令所使用的python版本号

[root@bjzw-mcu01-x86p-app01 ~]# vim /usr/bin/yum

#!/usr/bin/python2.6

本文出自 “云人生” 博客,请务必保留此出处http://ovcer.blog.51cto.com/1145188/1643751

yum

标签:yum

原文地址:http://ovcer.blog.51cto.com/1145188/1643751

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