repo init 拉代码过程中出现如下报错(下面的方法还是无效,主要是repo脚本有问题,暂时先不更新)

本文指导读者如何在国内因网络限制无法从谷歌源下载repo工具时,通过替换为清华大学镜像来解决安装问题。步骤包括创建bin目录、下载repo到本地并修改其URL。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


 

In i.MX Yocto Project User's Guide document 

Quick Start part:

Install the `repo` utility:
To get the BSP you need to have "repo" installed. This only needs to be done once.
$: mkdir ~/bin
$: curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$: chmod a+x ~/bin/repo
$: PATH=${PATH}:~/bin

由于这里安装repo的REPO_URL是谷歌的源,而由于国内“墙”的原因导致下载失败,错误为

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 101] Network is unreachable

针对这个问题,解决方案如下:

1. 获取repo

# cd ~
# mkdir bin
# cd bin
# curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
# chmod a+x ~/bin/repo
# export PATH=${PATH}:~/bin

2. 修改repo文件

打开~/bin/repo文件并修改google地址
# vi ~/bin/repo

From
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
To
REPO_URL = 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值