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:
$ ./adb
bash: ./adb: No such file or directory
It is there though:
$ ls -al ./adb
-rwxrwxrwx 1 thomas thomas 1231255 Jan 17 13:31 ./adb
$ 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 distribution?
To run a 32-bit executable file on a 64-bit multi-architecture Ubuntu system, you have to add the
i386
architecture and install the three library packageslibc6:i386
,libncurses5:i386
, andlibstdc++6:i386
:Or if you are using Ubuntu 12.04 LTS (Precise Pangolin) or below, use this:
Then:
If fails, do also
After these steps, you should be able to run the 32-bit application:
"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 haveldd
command available. This commandldd ./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.Additionally to the excellent answer of Zanna and Avinash Raj I had to install gcc-multilib as well:
Possibly this is because I wanted to run an old gcc version on 64bit.
And if you want to use "adb" there is a package for it:
And about 32-bit libraries - only:
will be enough.
Just an addition to Zanna:
The following has solved the android studio problem of "unable to install libraries":
This replaces missing library libstdc++6-i386 which is probably because the package has been obsoleted. Not sure why this specific library was important.