当安装和yum配置相关的包后报yum模块找不到
yum install -y yum-utils device-mapper-persistent-data lvm2
yum list|grep 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
# 查看/usr/bin/yum
more /usr/bin/yum
#!/usr/bin/python
import sys
try:
import yum
except ImportError:
print >> sys.stderr, """
yum 包是集成在Python2.6版本中的,而Linux默认都是安装Python2.6,且执行文件为/usr/bin/python2.6
上述包安装后,/usr/bin/yum文件被变更,Python执行路径变为了/usr/bin/python,将其改为/usr/bin/python2.6即可