Java教程

完美的失败方案让 repo init 安卓源码仓库恢复到最初状态

本文主要是介绍完美的失败方案让 repo init 安卓源码仓库恢复到最初状态,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

repo sync -d

报错

The program 'repo' can be found in the following packages:
 * phablet-tools
 * repo
Try: sudo apt install <selected package>

安装repo

sudo apt install repo

没有repo init

error: command 'sync' requires repo to be installed first.
         Use "repo init" to install it here.

进入.repo文件夹

cd ./.repo

初始化repo init 失败

因为每次都要去查询 所以要每次的初始化

repo init

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out

链接仓库失败

修改初始化语句 替换为清华源

repo init -u https://android.googlesource.com/platform/manifest --repo-url https://gerrit-google.tuna.tsinghua.edu.cn/git-repo

还是失败

repo init -u https://android.googlesource.com/platform/manifest --repo-url https://gerrit-google.tuna.tsinghua.edu.cn/git-repo
fatal: Cannot get https://gerrit-google.tuna.tsinghua.edu.cn/git-repo/clone.bundle
fatal: error [Errno -2] Name or service not known

再次更换

repo init  --repo-url=https://gerrit-googlesource.lug.ustc.edu.cn/git-repo

再次失败

repo init  --repo-url=https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
Get https://gerrit-googlesource.lug.ustc.edu.cn/git-repo/clone.bundle
Get https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
fatal: unable to access 'https://gerrit-googlesource.lug.ustc.edu.cn/git-repo/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

repo init -u --repo-url=https://gerrit-googlesource.lug.ustc.edu.cn/git-repo

最终办法 直接上代理

虚拟机配置代理地址 192.168.10.10 1080

访问谷歌没问题了

再次上

还是失败

repo init
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out

关闭刚才那个命令行窗口 重来几次次

失败 失败 失败

$ repo init
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
fatal: unable to access 'https://gerrit.googlesource.com/git-repo/': Failed to connect to gerrit.googlesource.com port 443: Connection timed out
tom@ubuntu:~/Android8.0/android-8.0.0_r1/.repo$ repo init
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error EOF occurred in violation of protocol (_ssl.c:590)
tom@ubuntu:~/Android8.0/android-8.0.0_r1/.repo$ repo init
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
fatal: unable to access 'https://gerrit.googlesource.com/git-repo/': Failed to connect to gerrit.googlesource.com port 443: Connection timed out

再搜搜解决方案

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest是清华提供的镜像源
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest是中国科学技术大学的镜像源

这篇关于完美的失败方案让 repo init 安卓源码仓库恢复到最初状态的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!