折騰着搞 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