repo init 错误问题解决方法

我们在开发的过程中经常用到repo工具,但是由于网络的原因经常下载失败,例如在下载Trusty代码的时候就遇到如下错误:

y@ubuntu:~/project/repo$ repo init -u https://android.googlesource.com/trusty/manifest -b master
Downloading Repo source from https://gerrit.googlesource.com/git-repo
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 111] Connection refused
fatal: cloning the git-repo repository failed, will remove '.repo/repo'

那这个怎么解决呢,可以修改home 目录下的 .bashrc文件。

vim ~/.bashrc

在文件的末尾添加如下命令:

 export PATH=~/bin:$PATH
 export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'

保存文件后运行命令,使更改生效:

source ~/.bashrc

好了现在可以下载你要的源代码了。

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值