安装git gnupg gnupg2
相关链接
https://mirrors.tuna.tsinghua.edu.cn/help/openthos-src/
https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/
https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
1下载repo
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod +x repo
2修改repo
编辑repo 把
REPO_URL = 'https://gerrit.googlesource.com/git-repo' 修改为
https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
3 repo init 初始化仓库
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/openthos-src/manifest -b marshmallow-x86
出现
gpg: keyblock resource '/home/iamhuskar/.repoconfig/gnupg/pubring.kbx': No such file or directory
gpg: no writable keyring found: Not found
gpg: error reading '[stdin]': General error
gpg: import from '[stdin]' failed: General error
gpg: Total number processed: 0
fatal: registering repo maintainer keys failed
记得安装gnupg 和gnupg2
git出现问题配置
git config --global user.email "you@example.com
git config --global user.name "Your Name"
4 执行 repo sync --no-tags --no-clone-bundle
Fetching project platform/external/flac
Fetching project platform/external/jsilver
Fetching project platform/external/apache-harmony
Fetching project platform/external/srtp
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:01:00 --:--:-- 0
会开始下载一些资源。待会儿又会出现无法从google取得源的情况
fatal: unable to access 'https://android.googlesource.com/platform/external/srtp/': Connection timed out after 300048 milliseconds
fatal: unable to access 'https://android.googlesource.com/platform/external/apache-harmony/': Connection timed out after 300017 milliseconds
fatal: unable to access 'https://android.googlesource.com/platform/external/jsilver/': Connection timed out after 300017 milliseconds
fatal: unable to access 'https://android.googlesource.com/platform/external/flac/': Connection timed out after 300022 milliseconds
error: Cannot fetch platform/external/apache-harmony
此时要修改xml数据里面的
把所有的
https://android.googlesource.com/
修改为https://aosp.tuna.tsinghua.edu.cn/
再次执行repo sync --no-tags --no-clone-bundle
遇到的404 以及bundle错误都可以忽略
如果出现 exit due to fetch error 可以试试在repo加入 -f命令