PDA

View Full Version : /bin/sh: bad interpreter: Permission denied



zeus
19th July 2004, 02:31 AM
Every time i execute shell i got this error

bash: ./configure: /bin/sh: bad interpreter: Permission denied

What wrong with my system, it's just happened..as i can remmembered i didnt do nothing wrong ....

I can not compile programs...

Jman
19th July 2004, 03:47 AM
Assuming you have the bash shell, /bin/sh should be a symlink to bash. First set the right permissions on bash
chmod 755 /bin/bash then create the link
ln -s bash /bin/sh

zeus
19th July 2004, 02:32 PM
Allready done that, but still got the error :/

Picomp314
19th July 2004, 02:46 PM
do you get this when using any user (root, non-root...)?

zeus
21st July 2004, 03:55 AM
I got this with any users, root or non root.

Thanks for replaying...i am beginning to give up...

I been looking for bashrc in /etc but i think there's nothing wrong with it. And ~/.bashrc either.

Jman
21st July 2004, 12:08 PM
Could you clarify what you are doing? It looks like you're trying to run a configure script. (That's trying to run another intrepreter?)

zeus
21st July 2004, 02:22 PM
Sorry for my english.

I can not run ./configure because every time i run it it fails looking for GCC . Normaly u can run configure directly without execute sh right?
Normal way in Terminal:
$./configure <<--if i run like this it will give me /bin/sh: bad interpreter: Permission denied

With sh:
$sh ./configure <<-works but it fails to find gcc.

Than I check my environment path, bashrc files. It all pointing ti normal bin directory /usr/bin, /bin.

I think this problem happening after i try to install ATI Radeon driver (with patch). Because before that, i can compile some programs.

Picomp314
21st July 2004, 04:25 PM
are you sure you actually have gcc installed???
seems that is the problem to me
sh ./configure should work fine

BerniE_
25th September 2005, 11:31 AM
Maybe the partition has been mounted as user and as noexec.
You can try to add in your fstab "exec" option to that partition.
Hope this can do the trick.

realopenit
28th October 2005, 10:09 AM
Hi,
I've gotten the same error and I may have an idea what the cause can be.

If you get the error

bash: ./configure: /bin/bash: bad interpreter: Permission denied
when trying to run ./configure from the command shell, try running instead:

$sh ./configure
as has been said before.

If that doesn't work because you get the error:

checking whether the C compiler works... configure: error: cannot run C compiled programs.
I think you'll find that you are using gcc 4.x instead of gcc 3.4, the older version.
There was some change with gcc 4.0 and many older systems haven't caught up with their configuration scripts.

I haven't fixed this error yet myself, but perhaps someone else has. I'd appreciate feedback! :)
Of course, you can try tyo deinstall gcc 4.x and install gcc 3.x instead but you may not know how or don't want to.

hope this helps someone,
Chris.
www.realopenit.nl

realopenit
28th October 2005, 10:37 AM
Oops.. scratch that... :) I figured it out... :shame mode on:

The problem with this situation is that you are trying to run a shell file on a partition for which you have no exec rights. I.e. an USB disk, a CD or DVD or some extended, logical hard disk or network partition.

In my case, I have my home dirs installed on a different partition, /dev/hda5. (This gives me freedom to reinstall Linux any time without tampering with my users' data and config/settings.)

Solution:
Anyway, I needed to add the 'exec' option to the /etc/fstab file when mounting that partition. :)
If it says 'defaults' on the line in /etc/fstab, then it also means you don't have exec rights on it.
Easy as pie! Piece of cake!

Another workaround, when you can't or don't want to mess with the fstab, is to compile/install source only from /tmp. That will always work!

Cheers,
Chris.
www.realopenit.nl