zoukankan      html  css  js  c++  java
  • yum 无法使用

    [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.
    
    It's possible that the above module doesn't 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 

    此时可以正常使用

  • 相关阅读:
    tyvj P3737 逐个击破
    最小生成树 kruskal
    最小生成树 prim
    code2039 骑马修栏杆
    前端优化
    数组1
    数组
    序列化对象
    解决iphone横屏时字体变大问题或者内容大小不一样等...
    Media Queries详解
  • 原文地址:https://www.cnblogs.com/xfbc/p/5416776.html
Copyright © 2011-2022 走看看