栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

完美解决国内仓库repo init和repo sync

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

完美解决国内仓库repo init和repo sync

repo init

因为每次repo sync都要先repo init同步远程仓库信息,因此被墙了每次都会失败。

-u 选择镜像地址
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest

是清华提供的镜像源

repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest
是中国科学技术大学的镜像源
用了镜像还是失败

原因就是你不是首次的init 之前的init可能用了国外的地址。导致

这时候我们来个整体的全局替换

修改文件尝试1 ~/.bashrc
sudo gedit ~/.bashrc

新增代码

# repo export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'

配置生效

source ~/.bashrc
修改文件尝试2 /usr/bin/repo
#!/usr/bin/python

## repo default configuration
##
REPO_URL = 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
REPO_REV = 'stable'

均同步失败

Get https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
fatal: unable to access 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

可以看到确实更换成功但是访问失败了 网络证书问题

若虚拟机为桥接模式更改为NAT模式

或者按照官方指导来

https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/

官方指导替换地址

-b 选择同步分支
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/450844.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号