• 升级python导致yum命令无法使用


    错误信息:

    [root@aliyun /]# 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 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.8 (default, Dec 3 2014, 08:48:50) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq

    查看yum版本:

    [root@aliyun /]# rpm -qa|grep yum
    yum-3.2.29-60.el6.centos.noarch
    yum-metadata-parser-1.1.2-16.el6.x86_64
    PackageKit-yum-0.5.8-23.el6.x86_64
    yum-plugin-fastestmirror-1.1.30-30.el6.noarch
    PackageKit-yum-plugin-0.5.8-23.el6.x86_64
    yum-utils-1.1.30-30.el6.noarch
    yum-plugin-security-1.1.30-30.el6.noarch

    查看python版本:

    [root@aliyun /]# whereis python
    python: /usr/bin/python /usr/bin/python2.6 /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/local/python2.7 /usr/share/man/man1/python.1.gz

    查找yum文件,并编辑此py文件

    [root@aliyun /]# which yum
    /usr/bin/yum

    再次运行yum,成功运行。

    至此,修复成功。

  • 相关阅读:
    django xadmin后台集成DjangoUeditor
    vm虚拟机下的ubuntu16.04配置静态ip(NAT方式)
    关于mysql里的concat
    xml转换为数组格式
    关于json的中文转码问题
    判断是否是微信浏览器
    数组和xml的互相转换的封装函数
    关于微信登录的接口开发
    curl的封装类
    php里关于文件下载的方法(两种)
  • 原文地址:https://www.cnblogs.com/ggjjl1/p/4139139.html
Copyright © 2020-2023  润新知