一 下载依赖
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev libc6-dev-i386 libncurses5 x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
二 更新apt
sudo apt-get update
三 安装repo
sudo apt-get install repo
如果报错 E: 无法定位软件包 repo
1.sudo apt-get update //(更新目录)
2.sudo apt-get upgrade //(更新文件)
3.sudo apt-get dist-upgrade //(更新依赖关系)
如果还不行
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
四 配置源
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
五 初始化仓库并指定分支
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-13.0.0_r40
如果没有设置git会提示配置
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
设置完再执行一遍
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-13.0.0_r40
六 同步全部源码
repo sync -c -j8