如何修复“错误的解释器"使用 yum 时出错? [英] How to fix "Bad interpreter" error when using yum?

查看:32
本文介绍了如何修复“错误的解释器"使用 yum 时出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ yum install httpd-devel
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

我该如何解决这个问题?

How can I fix this?

推荐答案

任何 bash、Perl 或 Python 脚本的第一行都会告诉 bash 在哪里可以找到正确的解释器.对于 yum,它是:

The first line of any bash, Perl, or Python script tells bash where to find the correct interpreter. For yum it is:

#!/usr/bin/python

您可以通过键入以下内容来判断 Python 的实际安装位​​置:

You can tell where Python is actually installed by typing:

which python

解决此问题的最佳方法是添加符号链接.例如:

The best way to fix this is to add a symbolic link. For example:

ln -s /usr/local/bin/python /usr/bin/python

这样您就不必在每个脚本中修复它.

That way you don't have to fix it in every script.

这篇关于如何修复“错误的解释器"使用 yum 时出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆