View Full Version : /bin/sh: bad interpreter: Permission denied
zeus
2004-07-18, 07:31 PM CDT
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
2004-07-18, 08:47 PM CDT
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
2004-07-19, 07:32 AM CDT
Allready done that, but still got the error :/
Picomp314
2004-07-19, 07:46 AM CDT
do you get this when using any user (root, non-root...)?
zeus
2004-07-20, 08:55 PM CDT
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
2004-07-21, 05:08 AM CDT
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
2004-07-21, 07:22 AM CDT
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
2004-07-21, 09:25 AM CDT
are you sure you actually have gcc installed???
seems that is the problem to me
sh ./configure should work fine
BerniE_
2005-09-25, 04:31 AM CDT
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
2005-10-28, 03:09 AM CDT
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
2005-10-28, 03:37 AM CDT
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
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.