No such file or directory for existing executable

52,179

Solution 1

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.

Solution 2

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

Solution 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/

Share:
52,179

Related videos on Youtube

Fenfei
Author by

Fenfei

New graduate in software engineering. Solid skills in Java, JavaScript, HTML5, Android. Great passion for mobile device software. Looking for a job in Android or web development.

Updated on September 18, 2022

Comments

  • Fenfei
    Fenfei almost 2 years

    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?

    • xubuntix
      xubuntix over 12 years
      please add the output of `ls -ahl /home/fenfei/app/android-sdk-linux/platform-tools/adb' to your question.
  • Fenfei
    Fenfei over 12 years
    Thank you very much. This is exactly the problem. Because android sdk doesn't have x64 version for linux. The adb works fine after installing ia32-libs
  • Ash
    Ash over 11 years
    Thanks, objdump helped me find missing dependencies in application I was trying to run.
  • davidcesarino
    davidcesarino about 11 years
    I always forget this after installing the SDK!
  • wulftone
    wulftone almost 11 years
    Awesomely helpful. I'm not sure how you got those libraries out of the objdump output, though.
  • phunehehe
    phunehehe over 10 years
    13.10 doesn't seem to have ia32-libs or ia32-libs-multiarch
  • phunehehe
    phunehehe over 10 years
    This is the only method that worked on 13.10. I noticed that I didn't need libncurses5:i386 though.
  • jpaugh
    jpaugh over 8 years
    I had this same problem recently. I would never have guessed it to be a 32/64 bit incompatibility! Thanks so much!