No such file or directory for existing executable [duplicate]

I just upgrade to Ubuntu 11.10 x64 from Ubuntu 11.04 32bit. But I find a really annoying problem. When I drag executable from file explorer to shell, the shell says
bash: /home/fenfei/app/android-sdk-linux/platform-tools/adb: No such file or directory
it's jus over there. I also have problem executing .../java. So I delete java, and extract the java package again then execute it and it works. But for /home/fenfei/app/android-sdk-linux/platform-tools/adb that method doesn't work. All of them are marked as executable.

Anyone can help me?


If you don't want to fill the computer up with i386 libs that you don't need.

For adb you just need:

sudo apt-get install libc6:i386 libstdc++6:i386

For aapt you need to add:

sudo apt-get install zlib1g:i386

You can see all the libs needed for an executable by running:

objdump -x .../adb | grep NEEDED

Some guesswork and searching is still needed to find the packages containing those files. The "Search the contents of packages" of http://packages.ubuntu.com/ is a good place to do that. Remember to add i386 as the architecture.


The message "no such file or directory" is displayed because there is a missing shared library. You can see these with the ldd command:

ldd /home/fenfei/app/android-sdk-linux/platform-tools/adb

Probably you are missing the 32 bit libs. You have to install:

apt-get install ia32-libs

On Ubuntu 13-10, ia32-libs is no longer available; instead, install the replacement packages:

apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

Kenno's observations could be useful for those who like me have had ia32-libs installed:

sudo apt-get install --reinstall libc6-i386

http://kenno.wordpress.com/2011/10/27/ubuntu-11-10-32-bit-applications-do-not-run-64-bit/