Can't Execute Binary on Ubuntu
Solution 1
Ok, I got the file from your URL (its under 800KB) and tried this (from a Cygwin terminal which was handy).
$ file p4
p4: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
But, you expect it to be statically linked, Why?
Update: Just to be sure, please confirm you are running a 32-bit Ubuntu.
If you are running a 64-bit system, you probably need the 'ia32-libs
' package.
Solution 2
chmod +x /usr/bin/p4
Solution 3
The intepreter readelf -a /usr/bin/p4 | grep interpreter
points to is probably missing. It's probably shipped in some compat package as pointed out by other commenters.
Solution 4
That's what happens when your executable isn't valid, it might be for another architecture or for another kernel. Or just a corrupted ELF header.
Solution 5
try file ./p4
and see what it says. Chances are you don't have the right libraries installed to run it (so it cannot load the binary at all - you get the same issues with Windows if you don't have the right dlls)
Related videos on Youtube
Comments
-
AJ. over 1 year
I am attempting install & configure Ubuntu on a machine. I just downloaded
'p4'
(aka Perforce command line client). It's a single file download that is executed via a statically-linked executable binary, there for I downloaded it using the following:wget http://www.perforce.com/downloads/perforce/r09.2/bin.linux26x86/p4
That dumped it right into the macines
/usr/bin
dir.Simple enough, right?
Except...
root@aj-ubuntu:/usr/bin# ll p4 -rwxr-xr-x 1 root root 748808 2010-02-11 16:54 p4 root@aj-ubuntu:/usr/bin# ./p4 -su: ./p4: No such file or directory root@aj-ubuntu:/usr/bin# /usr/bin/p4 -su: /usr/bin/p4: No such file or directory
What is happening here...?!
-
Bibhas about 14 yearsChange the title Dude.. :-\
-
AJ. about 14 years@Bibhas - fair enough.
-
Admin about 12 yearsUpdate: Just to be sure, please confirm you are running a 32-bit Ubuntu. If you are running a 64-bit system, you probably need the 'ia32-libs' package. tks for the tip u just save me from 8 hours of pain in hell :)
-
-
AJ. about 14 years@gbjbaanb - I tried 'ldd' and all it said was: " not a dynamic executable." I didn't know about 'file' though...I'll try that.
-
AJ. about 14 years@nik - see my note to @gbjbaanb below. I tried 'ldd' and all it said was: " not a dynamic executable." So, I assumed it was statically linked.
-
quack quixote about 14 yearsconfirm, that's what
file
gives on my system as well. i don't have a running Linux system available at the moment so i can't checkldd
. -
quack quixote about 14 yearsoutput:
[Requesting program interpreter: /lib/ld-linux.so.2]
... -
AJ. about 14 years@nik - your update nailed it. i am running 64-bit ubuntu but the binary was built for 32-bit architecture. i installed ia32-libs and that fixed it, thanks.