bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

yum 安装一个软件包,出现如下错误;
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

–查找python
#whereis python
python: /usr/bin/python2.6;57612e6e /usr/bin/python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python.1.gz

–查找yum
#whereis yum
yum: /usr/bin/yum /etc/yum.conf /etc/yum /usr/share/man/man8/yum.8.gz

–修改
#vi /usr/bin/yum
将首行的#!/usr/bin/python
更改成 #!/usr/bin/python2.6
保存退出!

解决!
这个错误是因为python的版本不匹配,只要在/usr/bin/yum中把第一行的#!/usr/bin/python改成#!/usr/bin/python2.6(系统中默认的版本)就可以啦

你可能感兴趣的:(Linux,server)