[ GUIDE ] How to Prepare Ubuntu 14.04 LTS Trusty Tahr to Compile Android ROMs

Search This thread

sylentprofet

Senior Member
Jun 10, 2010
283
1,857
Sacramento
--- If you would rather use a ready-to-go Virtual Machine, check out my post here. ---
--- Copied with permission from http://nathanpfry.com ---

TLDR; if you don't care about an explanation of what your system is doing,
click here to check out XDA Senior Member Aaahh's sweet two-step method based on my guide below.
Otherwise, keep reading!​

With a new version of Ubuntu comes an update to my world-famous guide for setting up a build environment to compile Android ROMs. 14.04 Trusty Tahr is the next Long Term Support edition of the popular Linux distro. The aim of this guide is to simplify the configuration process for you.

Follow the directions step-by-step. All you have to do is copy and paste the code sections in order and you will be up and running in no time!

This guide applies to all variations of Ubuntu 14.04 LTS Trusty Tahr 64 bit. Do not use the 32 Bit version.

Also, PAY CLOSE ATTENTION when to use "sudo" and when to not. It can make things funky if you do something as root that you shouldn't.

Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.

Ready to begin? Ok.

1) Unless it's a completely fresh Ubuntu installation, many of you may have the wrong version of Java installed. Let's fix that first.

The command below makes sure you're starting with a clean slate. Copy and paste it into a terminal (command prompt) window:

Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

If necessary, follow the on-screen instructions to remove any previous versions. Otherwise, move on to the next step.

It's time to install Java, one of the core pieces for compiling Android ROMs. Depending on which version of Android you are building, you will need the corresponding version of the Java Development Kit.

*** IF YOU ARE BUILDING ANDROID GINGERBREAD THRU KITKAT (2.3 - 4.4.x) USE THESE INSTRUCTIONS FOR JDK 6***
2) Copy and paste the following into the terminal:

Code:
sudo add-apt-repository ppa:webupd8team/java

This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 14.04.

3) Now you need to install the package. More copy-paste:

Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer

Follow the on-screen instructions. You must accept the Licensing Agreement to complete the install.

Press Enter to acknowledge the "OK", then tab over to "Yes" and press Enter again to accept the license. The installation will continue automatically.

4) Let's make sure the correct version of Java is activated. Run the terminal command:

Code:
java -version

You should see something like:

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

Continue to Step 5.


*** IF YOU ARE BUILDING ANDROID L AND ABOVE (CURRENT AOSP MASTER BRANCH) USE THESE INSTRUCTIONS FOR JDK 7***
2) Install Open-JDK 7 for the necessary Java development tools.

Code:
sudo apt-get update && sudo apt-get install openjdk-7-jdk

Follow the on-screen instructions.

3) Let's make sure the correct version of Java is activated. Run the terminal command:

Code:
java -version

You should see something like OpenJDK 1.7

Continue on to Step 5.


5) Back to a fresh terminal prompt. Install the main build tools with this command:

Code:
sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng

That's it on the package side of things. You guessed it, time for more Terminal. This really is the easiest way, I promise.

6) A program called "repo" lets you communicate with git servers and download all that precious source code. The next command will install it:

Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

7) Use your favorite text editor to open ~/.bashrc - I like nano:

Code:
sudo nano ~/.bashrc

8) At the very bottom (use the Page Down key) paste this code to a new (empty) line:

Code:
export PATH=~/bin:$PATH

9) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:

Code:
source ~/.bashrc

10) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder, but if you have limited space you may want to create it somewhere else. Faster is better, i.e. SSD would be best, USB external is basically unusable. Here we go:

Code:
mkdir ~/android
cd ~/android

11) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.

For the purposes of the tutorial, here's the command for AOKP KitKat:

Code:
repo init -u git://github.com/AOKP/platform_manifest.git -b kitkat

12) Almost there. Last step, it's a doozy. Time to get the source. Prepare yourself, 10+ GB of downloading await.

Don't worry, it's automated. Go to sleep. Eat something. Perhaps you have heard of this new thing the kids are doing called "going outside"? Yeah, I didn't think so. Me neither.

Hey everyone, it's the final terminal command:

Code:
repo sync

Check back periodically every hour or so. It all depends on how fast your connection is.

That should be everything. Now you're ready to build Android the right way. Good luck!

For those of you that want to build Lollipop (which requires JDK 1.7) but already have your system configured for GB-KK (JDK 1.6), here's the easiest way to update your system:

First, install OpenJDK7. At a terminal:

Code:
sudo apt-get install openjdk-7-jdk

Once that completes, you simply need to tell Linux to use the newer version of Java and Java Compiler to render content. Run the following two commands separately, making the correct selection for OpenJDK 1.7 both times when prompted. Again in the terminal:

Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac

That should do the trick! Have fun everyone..

Feel free to buy me a coconut water (donate) if you like my work. It would be greatly appreciated!

Please hit the "Thanks" button if this post helped you out!
 
Last edited:

fgdn17

Senior Member
Dec 10, 2010
64
23
not for me...

ppa:webupd8team/java no longer supports oracle-java6-installer.....

at least when I tried it on ubuntu 14.04 a week ago......

had to resort to the old fashion way of installing jdk from older oracle instructions...!!!

UPDATED:
----------------
seems at the time we tested(feb.4) it did not work but since then has been fixed...

at the time the OP posted it had been corrected, feb.7
 
Last edited:

sylentprofet

Senior Member
Jun 10, 2010
283
1,857
Sacramento
had to resort to the old fashion way of installing jdk from older oracle instructions...!!!

Respectfully, you're wrong.

Yesterday I tried the instructions (as I was writing the guide) with the latest Alpha of Xubuntu 14.04 and it works fine.

It appears they've updated the PPA within the last few days to support Trusty Tahr.

I wouldn't publish a guide that I hadn't verified myself as working, unlike some people.
 

fgdn17

Senior Member
Dec 10, 2010
64
23
well that implies they have fixed it...because on feb 4 we setup Ubuntu 14.04 and had to work around the issue
because it did not work.....

so did it work well for you a week ago???

maybe because of the different systems???

will give it a try again in the next couple of weeks if we get time...either way it's good to know
it has been corrected....

and BTW we also installed openjava 7, switched between the two and
build our source without issues.....

source was android-x86 kitkat
 
Last edited:
  • Like
Reactions: robert hesele

Aaahh

Senior Member
Nov 4, 2013
1,390
1,240
I used 14.04 early and i had to install some extra packages because things wouldn't work properly, just a heads up incase anyone is having problems...
 

PabloPL

Senior Member
May 27, 2008
103
69
I've build android 4.2 and 4.4 using openjdk 1.7, without any changes, using ubuntu 13.10 (some time ago in aosp there has been added patches which fixes build under java 7, of course it's not for all android versions).
 
I appreciate a detailed, step-by-step guide like this. In my experience here, I've found that far too many arrogant developers hold the opinion that since they had to find things out the hard way, everyone else should have to as well. Finding developers that actually want to help people out, rather than snub them with snot-nosed attitudes, is always refreshing, so thanks to the OP for the guide!
 

sylentprofet

Senior Member
Jun 10, 2010
283
1,857
Sacramento
Do you want me to post a second guide mid-thread? I'm just suggesting combining steps. Its a lengthy read and it could be much shorter.

Or start your own thread?

If you wanna post it in here as a reply, go ahead. When I can verify that it works I'd be happy to update the OP and credit you.

Also I've released Builduntu, a ready-to-go virtual machine. The link is at the top of the OP. No matter what system you've got (OSX, Win, other linux) you can import the machine into VirtualBox or VMWare and have a working development environment in minutes.
 
  • Like
Reactions: CAPS_ON
Now that I've built a completely new, modern machine, I'm going to repurpose my old system (which is still perfectly usable, with 8GB of RAM and an Intel Core2 Quad) as an Android development platform. I plan to install Linux Mint 14 on it, as I despise Unity with the blazing white heat of a million suns. :) I'll give your steps a try on it and post here how successful they were; if anything needs tweaking for Mint, you can add them to your instructions (it shouldn't, as Mint is based on Ubuntu).
 

Aaahh

Senior Member
Nov 4, 2013
1,390
1,240
This guide really complicates things. Most of this could be put into a single one-liner.

Here is a two liner, :p
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* && sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so && mkdir ~/bin && curl http://commondatastorage.googleapis....downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo && sudo nano ~/.bashrc
Copy and paste
export PATH=~/bin:$PATH
Code:
source ~/.bashrc && mkdir ~/android && cd ~/android
I purposly left out the repo init and sync, that way you can pick what source to init.
 

AdamOutler

Retired Senior Recognized Developer
Feb 18, 2011
5,224
9,826
Miami, Fl̨̞̲̟̦̀̈̃͛҃҅͟orida
Here is a two liner, :p
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* && sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so && mkdir ~/bin && curl http://commondatastorage.googleapis....downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo && sudo nano ~/.bashrc
Copy and paste
export PATH=~/bin:$PATH
Code:
source ~/.bashrc && mkdir ~/android && cd ~/android
I purposly left out the repo init and sync, that way you can pick what source to init.
Yep. you beat me to it.. I was mobile earlier so I couldn't really copy-pasta all of it into a post.
 
  • Like
Reactions: Toledo_JAB

desalesouche

Senior Member
Feb 6, 2012
3,651
4,297
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
g++-multilib : Depends: cpp (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: gcc-multilib (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++ (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++-4.8-multilib (>= 4.8.2-5~) but it is not going to be installed
libghc-bzlib-dev : Depends: libghc-base-dev-4.6.0.1-8aa5d
Depends: libghc-bytestring-dev-0.10.0.2-4f932
E: Unable to correct problems, you have held broken packages.


may i request some suggestion? thanks
 
Last edited:

Aaahh

Senior Member
Nov 4, 2013
1,390
1,240
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
g++-multilib : Depends: cpp (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: gcc-multilib (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++ (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++-4.8-multilib (>= 4.8.2-5~) but it is not going to be installed
libghc-bzlib-dev : Depends: libghc-base-dev-4.6.0.1-8aa5d
Depends: libghc-bytestring-dev-0.10.0.2-4f932
E: Unable to correct problems, you have held broken packages.


may i request some suggestion? thanks

try sudo apt-get autoremove then sudo apt-get update then sudo apt-get dist-upgrade then sudo dpkg --configure -a then if it still perist try to enable muitverse, if it still doesn't work then try trusty proposed or compiling by hand...
 
  • Like
Reactions: desalesouche

desalesouche

Senior Member
Feb 6, 2012
3,651
4,297
try sudo apt-get autoremove then sudo apt-get update then sudo apt-get dist-upgrade then sudo dpkg --configure -a then if it still perist try to enable muitverse, if it still doesn't work then try trusty proposed or compiling by hand...
all is fine now... thanks to these commands i could run point 5 and 6 from op
 

desalesouche

Senior Member
Feb 6, 2012
3,651
4,297
hi <while compiling cm11 on that fresh install of unbutu 14.04 i have that weird error? any idea? thank you.

Can't locate Switch.pm in @Inc (you may need to install the Switch module
@Inc contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
Import includes file: /home/desalesouche/cm11m3/out/target/product/u8860/obj/STATIC_LIBRARIES/libwebcore_intermediates/import_includes
make: *** [/home/desalesouche/cm11m3/out/target/product/u8860/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] Error 2

edit: i think i foound the solution here
http://answers.yahoo.com/question/index?qid=20130510115737AAfIgU5

hi did in terminal :
cpan App::cpanminus
then i choosed solution with sudo.
then i did in new terminal:
cpanm Switch

i restarted cm build and error seem to be gone... will confirm that.
 
Last edited:
  • Like
Reactions: kishoreinme

Top Liked Posts

  • There are no posts matching your filters.
  • 218
    --- If you would rather use a ready-to-go Virtual Machine, check out my post here. ---
    --- Copied with permission from http://nathanpfry.com ---

    TLDR; if you don't care about an explanation of what your system is doing,
    click here to check out XDA Senior Member Aaahh's sweet two-step method based on my guide below.
    Otherwise, keep reading!​

    With a new version of Ubuntu comes an update to my world-famous guide for setting up a build environment to compile Android ROMs. 14.04 Trusty Tahr is the next Long Term Support edition of the popular Linux distro. The aim of this guide is to simplify the configuration process for you.

    Follow the directions step-by-step. All you have to do is copy and paste the code sections in order and you will be up and running in no time!

    This guide applies to all variations of Ubuntu 14.04 LTS Trusty Tahr 64 bit. Do not use the 32 Bit version.

    Also, PAY CLOSE ATTENTION when to use "sudo" and when to not. It can make things funky if you do something as root that you shouldn't.

    Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.

    Ready to begin? Ok.

    1) Unless it's a completely fresh Ubuntu installation, many of you may have the wrong version of Java installed. Let's fix that first.

    The command below makes sure you're starting with a clean slate. Copy and paste it into a terminal (command prompt) window:

    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

    If necessary, follow the on-screen instructions to remove any previous versions. Otherwise, move on to the next step.

    It's time to install Java, one of the core pieces for compiling Android ROMs. Depending on which version of Android you are building, you will need the corresponding version of the Java Development Kit.

    *** IF YOU ARE BUILDING ANDROID GINGERBREAD THRU KITKAT (2.3 - 4.4.x) USE THESE INSTRUCTIONS FOR JDK 6***
    2) Copy and paste the following into the terminal:

    Code:
    sudo add-apt-repository ppa:webupd8team/java

    This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 14.04.

    3) Now you need to install the package. More copy-paste:

    Code:
    sudo apt-get update && sudo apt-get install oracle-java6-installer

    Follow the on-screen instructions. You must accept the Licensing Agreement to complete the install.

    Press Enter to acknowledge the "OK", then tab over to "Yes" and press Enter again to accept the license. The installation will continue automatically.

    4) Let's make sure the correct version of Java is activated. Run the terminal command:

    Code:
    java -version

    You should see something like:

    java version "1.6.0_45"
    Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

    Continue to Step 5.


    *** IF YOU ARE BUILDING ANDROID L AND ABOVE (CURRENT AOSP MASTER BRANCH) USE THESE INSTRUCTIONS FOR JDK 7***
    2) Install Open-JDK 7 for the necessary Java development tools.

    Code:
    sudo apt-get update && sudo apt-get install openjdk-7-jdk

    Follow the on-screen instructions.

    3) Let's make sure the correct version of Java is activated. Run the terminal command:

    Code:
    java -version

    You should see something like OpenJDK 1.7

    Continue on to Step 5.


    5) Back to a fresh terminal prompt. Install the main build tools with this command:

    Code:
    sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng

    That's it on the package side of things. You guessed it, time for more Terminal. This really is the easiest way, I promise.

    6) A program called "repo" lets you communicate with git servers and download all that precious source code. The next command will install it:

    Code:
    mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

    7) Use your favorite text editor to open ~/.bashrc - I like nano:

    Code:
    sudo nano ~/.bashrc

    8) At the very bottom (use the Page Down key) paste this code to a new (empty) line:

    Code:
    export PATH=~/bin:$PATH

    9) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:

    Code:
    source ~/.bashrc

    10) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder, but if you have limited space you may want to create it somewhere else. Faster is better, i.e. SSD would be best, USB external is basically unusable. Here we go:

    Code:
    mkdir ~/android
    cd ~/android

    11) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.

    For the purposes of the tutorial, here's the command for AOKP KitKat:

    Code:
    repo init -u git://github.com/AOKP/platform_manifest.git -b kitkat

    12) Almost there. Last step, it's a doozy. Time to get the source. Prepare yourself, 10+ GB of downloading await.

    Don't worry, it's automated. Go to sleep. Eat something. Perhaps you have heard of this new thing the kids are doing called "going outside"? Yeah, I didn't think so. Me neither.

    Hey everyone, it's the final terminal command:

    Code:
    repo sync

    Check back periodically every hour or so. It all depends on how fast your connection is.

    That should be everything. Now you're ready to build Android the right way. Good luck!

    For those of you that want to build Lollipop (which requires JDK 1.7) but already have your system configured for GB-KK (JDK 1.6), here's the easiest way to update your system:

    First, install OpenJDK7. At a terminal:

    Code:
    sudo apt-get install openjdk-7-jdk

    Once that completes, you simply need to tell Linux to use the newer version of Java and Java Compiler to render content. Run the following two commands separately, making the correct selection for OpenJDK 1.7 both times when prompted. Again in the terminal:

    Code:
    sudo update-alternatives --config java
    sudo update-alternatives --config javac

    That should do the trick! Have fun everyone..

    Feel free to buy me a coconut water (donate) if you like my work. It would be greatly appreciated!

    Please hit the "Thanks" button if this post helped you out!
    26
    fixed two-liner

    Here is a two liner, :p

    The command for fetching repo from googleapi's was incorrect. Had an elipsis in the link instead of the proper url. Here's the fixed version:

    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* && sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && sudo apt-get install git gnupg ccache lzop libglapi-mesa-lts-utopic:i386 libgl1-mesa-dri-lts-utopic:i386 flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z1-dev libgl1-mesa-glx-lts-utopic:i386 libgl1-mesa-dev-lts-utopic g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libreadline6-dev lib32readline-gplv2-dev libncurses5-dev bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev squashfs-tools pngcrush schedtool dpkg-dev && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so && mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo && sudo nano ~/.bashrc

    At the bottom of bashrc paste the following line:

    Code:
    export PATH=~/bin:$PATH

    Ctrl-O to save and Ctrl-X to exit. Then run:

    Code:
    source ~/.bashrc && mkdir ~/android && cd ~/android

    Thanks Aaahh!
    9
    I appreciate a detailed, step-by-step guide like this. In my experience here, I've found that far too many arrogant developers hold the opinion that since they had to find things out the hard way, everyone else should have to as well. Finding developers that actually want to help people out, rather than snub them with snot-nosed attitudes, is always refreshing, so thanks to the OP for the guide!
    4
    had to resort to the old fashion way of installing jdk from older oracle instructions...!!!

    Respectfully, you're wrong.

    Yesterday I tried the instructions (as I was writing the guide) with the latest Alpha of Xubuntu 14.04 and it works fine.

    It appears they've updated the PPA within the last few days to support Trusty Tahr.

    I wouldn't publish a guide that I hadn't verified myself as working, unlike some people.
    4
    This guide really complicates things. Most of this could be put into a single one-liner.

    Here is a two liner, :p
    Code:
    sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* && sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so && mkdir ~/bin && curl http://commondatastorage.googleapis....downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo && sudo nano ~/.bashrc
    Copy and paste
    export PATH=~/bin:$PATH
    Code:
    source ~/.bashrc && mkdir ~/android && cd ~/android
    I purposly left out the repo init and sync, that way you can pick what source to init.