Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed Ubuntu 14.04 and the current Android development SDK, which contains 32-bit executables. I found that I cannot run those 32-bit binaries. Trying to start them from bash gives me an error:

thomas@thinkpad$ ./adb

bash: ./adb: No such file or directory

It is there though:

thomas@thinkpad$ ls -al ./adb

-rwxrwxrwx 1 thomas thomas 1231255 Jan 17 13:31 ./adb

thomas@thinkpad$ 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. Same symptom for all the other 32-bit tools in the Android SDK. 

In olden days one could just install 32-bit libraries on 64-bit Ubuntu to get 32-bit support, but that does not seem to work anymore.

How do I run 32-bit apps on a 64-bit Ubuntu 14.04?

share|improve this question

4 Answers 4

up vote 20 down vote accepted

To run 32bit executable file in a 64 bit multi-arch Ubuntu system, you have to add i386 architecture and install libc6:i386,libncurses5:i386,libstdc++6:i386 these three library packages.

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo ./adb
share|improve this answer
1  
Sorry, did not do anything. Also tried to install ia32-libs, but that package does not exist anymore. –  Thomas Stuefe Apr 24 at 7:48
    
Please try my edit. It will surely works. –  Avinash Raj Apr 24 at 8:10
2  
Nice! Thank you, that did the trick! –  Thomas Stuefe Apr 24 at 12:16
    
@AvinashRaj This helped me out! However, what is the last command "sudo ./adb" supposed to do actually? –  Marcel May 22 at 21:33
1  
It executes the 32bit adb binary file which was present in the current directory. –  Avinash Raj May 23 at 1:05

And if you want to use "adb" there is a package for it:

sudo apt-get install android-tools-adb

And about 32-bit libraries - only:

sudo apt-add-architecture i386

will be enough.

share|improve this answer
    
Thanks for the tip, but I wanted to use the android tools downloaded from google, not the ones in the Ubuntu repos. I am also not sure about the completeness of that package. –  Thomas Stuefe Apr 24 at 12:36
    
Ubuntu repositories must have the new version. The package contains only adb. If you want fastboot - there is package for it too :) –  alb3rtano0012 Apr 24 at 12:44

"No such file or directory" may appaear when you have your binary, but it lacks some libraries. If you install build-essential package, you will have ldd command available. This command ldd ./adb | grep not will show you what libraries are missing. Just install these libraries in i386 arch with apt. Like this: apt-get install libmissing:i386 Beware, some buggy packages will try to delete 64bit version firs.

share|improve this answer
    
Thank you, that would explain the weird error message. I was first confused why bash would give me this error (instead of some error coming more clearly from the child process which misses the libraries), but now I guess bash just sees exec(3) returning ENOENT and prints this out. –  Thomas Stuefe Apr 24 at 12:30

You also have to remember that i686 architecture wasn't a sandybridge type of design as you may have now. The true difference is the fact the more recent 64-bit architectures now lack a northbridge and the processor now handles the tasks that would typically be handled by the northbridge. This translates as a completely different synapsis that your 32-bit program hasn't anticipated and compensated for. Linux, I would have to say, isn't intuitive enough to breakdown a 32 bit thread into a 64 bit processor. Think of bytes as a bus(Yes, that's funny xD) and bits as the passengers on the bus. your i386 program has 32 dudes on a bus that carrys 64. The bus driver then says to you and every one aboard, that's not fair to the other 32 bits and I'm not going anywhere! Then promptly starts eating his launch.

share|improve this answer
    
This doesn't make any sense at all. –  sstn Nov 12 at 10:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.