43

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?

Jorge Castro
  • 71,754
Fenfei
  • 541
  • 1
    please add the output of `ls -ahl /home/fenfei/app/android-sdk-linux/platform-tools/adb' to your question. – xubuntix Oct 29 '11 at 11:41

3 Answers3

68

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.

phunehehe
  • 311
niknah
  • 681
  • 1
    Thanks, objdump helped me find missing dependencies in application I was trying to run. – Ash Feb 23 '13 at 10:13
  • Awesomely helpful. I'm not sure how you got those libraries out of the objdump output, though. – wulftone Sep 18 '13 at 22:52
  • This is the only method that worked on 13.10. I noticed that I didn't need libncurses5:i386 though. – phunehehe Oct 27 '13 at 07:21
  • 3
    Worked for me on Ubuntu 14.04. Don't forget to run sudo dpkg --add-architecture i386 && sudo apt-get update before – Morgan Courbet Apr 20 '14 at 18:38
  • I had this same problem recently. I would never have guessed it to be a 32/64 bit incompatibility! Thanks so much! – jpaugh Oct 03 '15 at 04:00
41

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
greg_1_anderson
  • 100
  • 1
  • 9
mkm
  • 3,189
3

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/

Jorge Castro
  • 71,754
Psh
  • 31