19

I want to install repo for working with the Android source files. How to install repo?

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Subrat
  • 3,928
  • 6
  • 39
  • 48

5 Answers5

31

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

z3ntu
  • 190
  • 7
  • 20
Erich Douglass
  • 51,744
  • 11
  • 75
  • 60
  • Good answer when it was posted. The link and steps have changed since. https://source.android.com/docs/setup/download#installing-repo – John Michelau May 22 '23 at 15:19
12

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

sudo apt-get install repo -y

evanhutomo
  • 627
  • 1
  • 11
  • 24
prehistoricpenguin
  • 6,130
  • 3
  • 25
  • 42
7

Many distros include repo, so you might be able to install from there.

# Debian/Ubuntu.
$ sudo apt-get install repo

# Gentoo.
$ sudo emerge dev-vcs/repo

## Linux Mint
$ sudo rm /etc/apt/preferences.d/nosnap.pref
$ sudo apt update
$ sudo apt install snapd
$ sudo snap install git-repo

You can install it manually as well as it's a single script.

$ mkdir -p ~/.bin
$ PATH="${HOME}/.bin:${PATH}"
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
$ chmod a+rx ~/.bin/repo

See Official website: https://gerrit.googlesource.com/git-repo/

kgbook
  • 388
  • 4
  • 16
3

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

curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
david
  • 33
  • 3
  • Hello David, Could not initialize repo client using the below command. $ repo init -u git://android.git.kernel.org/platform/manifest.git and Tried to do it with repo init -u https://android.googlesource.com/platform/manifest but not working. Where is the latest URL to initialize repo? – Sharath Oct 19 '17 at 04:06
1

Repo is included in phablet-tools package which is available from official package repository for Ubuntu releases starting from 14.04

Vasily Makarov
  • 311
  • 2
  • 11