1、sudo apt-get install curl

2、curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /bin/repo

提示:

bash: /bin/repo: Permission denied

3、curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/repo

下载成功

4、sudo mv repo /bin/

5、chmod a+x /bin/repo

到此,repo已经准备好了,下面可以开始下载代码了。


下载命令类似:

$ repo sync


(注意:如果上面的url修改成:http://android.googlesource.com/platform/manifest,速度会快很多)


repo init执行后,会提示git没有安装,此时:

sudo apt-get install git

安装好git后,重新执行命令