How to install Android's repo on my Ubuntu system?

From https://source.android.com/source/downloading#installing-repo:

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir working-directory-name 
$ cd working-directory-name 
$ repo init -u git://android.git.kernel.org/platform/manifest.git 

Authoritative instructions


If you are using Ubuntu 16.04, just use this command line:

sudo apt-get install repo -y


The location changed to http://commondatastorage.googleapis.com/git-repo-downloads/repo:

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo