I am looking to initialise the build environment for the AOSP codebase (or for that matter, any Android source), and one of the first steps in the process is to;

$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386

$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

I have a (newly installed) Ubuntu 12.04 64-bit machine and run into trouble with 32-bit dependencies in the past. I want to get this one right from the start.

I have installed all the packages (through Synaptic or apt-get) with the exception of;


apt-get for these three alone returns;

danielgt@danielgt-linux:~$ sudo apt-get install libncurses5-dev:i386 libgl1-mesa-glx:i386 zlib1g-dev:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgl1-mesa-glx:i386 is already the newest version.
The following extra packages will be installed:
libc6-dev:i386 linux-libc-dev:i386
Suggested packages:
glibc-doc:i386 manpages-dev:i386 ncurses-doc:i386
Recommended packages:
gcc:i386 c-compiler:i386
The following packages will be REMOVED
build-essential g++ g++-multilib gcc gcc-multilib libncurses5-dev
The following NEW packages will be installed
libc6-dev:i386 libncurses5-dev:i386 linux-libc-dev:i386 zlib1g-dev:i386
0 upgraded, 4 newly installed, 6 to remove and 0 not upgraded.
Need to get 6,349 kB of archives.
After this operation, 23.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? n

It seems counter-intuitive for me to run the last command and;

  1. Remove the build-essential and g++-multilib packages indicated as required in the original command.
  2. Remove a 64-bit package (libcurses5-dev) to replace it with the i386 variant, as a 64-bit system is required to build.

Additionally, I don't seem to have libgl1-mesa-glx:i386 installed, though I do have the 64-bit variant (libgl1-mesa-glx). Is that explained by the second (ln) command ran?

Any advice as to how I should proceed would be welcome?

  • I have also run into the same problem. I think it's because 12.04.2 has some quantal packages which are hindering installation of old pacakges. Maybe if I can get a 12.04 CD which does not have quantal backports...
    – recluze
    Feb 22, 2013 at 6:32

3 Answers 3


I installed Ubuntu 12.04.2 amd64 and the following command worked to me. The second command (symbolic link) is not needed.

sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx-lts-quantal:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386

I did not install openjdk-6-jdk, instead, I used to use jdk-6u37-linux-x64.bin.

cd ~
export PATH=~/jdk1.6.0_37/bin:$PATH

I had same problem when installing libgl1-mesa-glx:i386. Then I remove that one and install libgl1-mesa-glx-lts-quantal:i386. It works for me. I can get /usr/lib/i386-linux-gnu/mesa/libGL.so.1.


Recommended answers fail with Ubuntu 12.04.03 (AMD64). Ubuntu reboot hangs. I am able to get to a command prompt by pressing escape immediately after the GUI startup screen displays with the color-cycling dots.

I was able to get the GUI to start up correctly by following the instructions from https://askubuntu.com/users/125872/grzegorz for the following post:

Ubuntu won't boot after initializing the Build Environment for Android

Investigating whether the Android environment is functional....

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .