Linux – Can’t Execute Binary on Ubuntu

bashlinuxperforceUbuntuubuntu-9.10

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

Best Answer

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.