up vote 3 down vote favorite
share [g+] share [fb]

I can't believe I'm asking this...clearly I'm in rare form today.

Trying to setup a new Ubuntu machine and just downloaded 'p4' (Perforce command line client). It's a single file download - a statically-linked binary executable, so I just did:

wget http://www.perforce.com/downloads/perforce/r09.2/bin.linux26x86/p4

...right into /usr/bin. Simple enough. 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 in the world is happening here...?!

Thanks in advance for your ridicule :)

-aj

link|improve this question

Change the title Dude.. :-\ – Bibhas Feb 11 '10 at 22:06
@Bibhas - fair enough. – AJ. Feb 11 '10 at 22:07
feedback

6 Answers

up vote 3 down vote accepted

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.

link|improve this answer
@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. – AJ. Feb 12 '10 at 1:44
confirm, 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 check ldd. – quack quixote Feb 12 '10 at 8:06
1  
@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. – AJ. Feb 14 '10 at 14:44
feedback

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)

link|improve this answer
@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. Feb 11 '10 at 22:28
feedback

Do ls -lb p4* to see if there are any stray characters in the filename.

link|improve this answer
feedback

chmod +x /usr/bin/p4

link|improve this answer
feedback

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.

link|improve this answer
feedback

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.

link|improve this answer
output: [Requesting program interpreter: /lib/ld-linux.so.2] ... – quack quixote Feb 12 '10 at 21:56
feedback

Your Answer

 
or
required, but never shown

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