'No such file or directory' error in bash, but the file exists?

On Ubuntu, I get a 'No such file or directory' error when I try to execute a command.

I have checked with 'ls -la' , the file 'adb' is there and it has 'x' flag So why I am getting a 'No such file or directory'?

~/Programs/android-sdk-linux_x86/platform-tools$ ./adb
 bash: ./adb: No such file or directory
~/Programs/android-sdk-linux_x86/platform-tools$ ls -la
 total 34120
 drwxrwxr-x 3 silverstri silverstri     4096 2011-10-08 18:50 .
 drwxrwxr-x 8 silverstri silverstri     4096 2011-10-08 18:51 ..
 -rwxrwxr-x 1 silverstri silverstri  3764858 2011-10-08 18:50 aapt
 -rwxrwxr-x 1 silverstri silverstri   366661 2011-10-08 18:50 adb
 -rwxrwxr-x 1 silverstri silverstri   906346 2011-10-08 18:50 aidl
 -rwxrwxr-x 1 silverstri silverstri   328445 2011-10-08 18:50 dexdump
 -rwxrwxr-x 1 silverstri silverstri     2603 2011-10-08 18:50 dx
 drwxrwxr-x 2 silverstri silverstri     4096 2011-10-08 18:50 lib
 -rwxrwxr-x 1 silverstri silverstri 14269620 2011-10-08 18:50 llvm-rs-cc
 -rwxrwxr-x 1 silverstri silverstri 14929076 2011-10-08 18:50 llvm-rs-cc-2
 -rw-rw-r-- 1 silverstri silverstri      241 2011-10-08 18:50 llvm-rs-cc.txt
 -rw-rw-r-- 1 silverstri silverstri   332494 2011-10-08 18:50 NOTICE.txt
 -rw-rw-r-- 1 silverstri silverstri      291 2011-10-08 18:50 source.properties
link|improve this question

62% accept rate
 
 
what do you get if you run file adb – jdigital Oct 9 '11 at 5:43
 
i get this '$ file adb adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped ' – michael Oct 13 '11 at 3:56
feedback

4 Answers

up vote 3 down vote accepted

It's an executable file that misses required libraries. Use ldd to see what it needs, then provide these files.

link|improve this answer
 
 
i get this '$ ldd ./adb not a dynamic executable' – michael Oct 11 '11 at 0:36
feedback

You probably are on 64-bit and need the 32-bit libs. On ubuntu that involves

sudo apt-get install ia32-libs
link|improve this answer
 
 
damn that installs a lot of stuff. But it works. – Travis R May 1 at 2:43
feedback
sudo apt-get install --reinstall libc6-i386

is also need for me.

link|improve this answer
 
 
Did you mean that helped? Any idea why? Where did you get this from? – Tom Wijsman Apr 12 at 15:56
feedback

For adb make sure you have the SDK unpacked and have run the SDK Manager to fully populate the SDK. Additionally make sure you have the following installed: A.) JDK 6 or better B.) lib32stdc++6 C.) lib32ncurses5

hoffmanc was the closest to getting it right, I don't really understand why the answer from Daniel Beck is marked as correct when it's not even close and has nothing to do with the problem.

Incidentally, if you try to run a truly non-existant command (i.e.:

# fakecommand

you'll get: fakecommand: command not found, whereas in your situation the output you are seeing is actually coming from adb even though it's not very clear that is the case.

link|improve this answer
posted @ 2012-05-25 09:05  wolaizhaoziliao  阅读(730)  评论(0)    收藏  举报