折腾着搞 openvpn 网站服务器 yum指令 出了点问题

------------------------------------------------------------

[root@cloud ~]# 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.6.6 (r266:84292, Feb 22 2013, 00:00:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]

-----------------------------------------------------------

原因:

根据报错信息提示,yum 会用到 Python 的某些模块。当前模块安装错误 或者 Python 版本错误

当前错误是 Python 版本错误

 

解决:

1. 查看yum版本 rpm -qa |grep yum

    查看python版本 whereis python

       发现 python果然安装了两个版本2.6和2.7版本

 

2. 编辑 yum 使用的 python 版本

    vi /usr/bin/yum

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

 

相关文章:

  • 2022-12-23
  • 2022-01-19
  • 2021-11-28
  • 2021-08-10
  • 2022-01-26
  • 2022-02-12
  • 2022-12-23
  • 2022-01-06
猜你喜欢
  • 2021-08-19
  • 2022-12-23
  • 2021-12-20
  • 2021-07-20
  • 2021-11-28
  • 2021-08-13
  • 2021-11-02
相关资源
相似解决方案