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

How can I fix this?

1
  • 2
    Is there a file called /usr/bin/python or /usr/bin/yum ? if either of them is missing, you could create a soft link to the executable.
    – mgilson
    Jul 10, 2012 at 20:38

1 Answer 1

6

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.