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

Posted guo2733

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory相关的知识,希望对你有一定的参考价值。

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

python多版本造成额问题 找不到python的路径 所以保持

-查找python
#whereis python
python: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 /usr/local/bin/python2.7 /usr/local/bin/python /usr/local/bin/python2.7-config /usr/local/lib/python2.7 /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.4
保存退出!

解决!

 

以上是关于-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory的主要内容,如果未能解决你的问题,请参考以下文章

Linux 执行yum clean all报错File "/usr/bin/yum", line 30 except KeyboardInterrupt,

openEuler 之 dnf 换 yum 大法

yum 安装报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:

python升级带来的yum异常:File "/usr/bin/yum", line 30

python升级带来的yum异常:File "/usr/bin/yum", line 30

python升级带来的yum异常(解决错误File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:)