我是git和repo的新手,使用的操作系统是Windows 7,所以我使用cygwin。我已经在cygwin安装包中安装了git。之后,我尝试在cygwin中使用以下命令进行repo。
$ repo init-u git://android.git.kernel.org/platform/manifest.git
我遇到了这样的错误:
bash: repo: command not found
我觉得我需要为repo安装cygwin。接下来我需要什么才能获得repo?
我是git和repo的新手,使用的操作系统是Windows 7,所以我使用cygwin。我已经在cygwin安装包中安装了git。之后,我尝试在cygwin中使用以下命令进行repo。
$ repo init-u git://android.git.kernel.org/platform/manifest.git
我遇到了这样的错误:
bash: repo: command not found
我觉得我需要为repo安装cygwin。接下来我需要什么才能获得repo?
情况1:还没有安装Google仓库?
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
在需要时使用以下校验和:
对于版本1.25,它是
d06f33115aea44e583c8669375b35aad397176a411de3461897444d247b6c220
对于版本1.26,它是0cf5f52bcafb8e1d3ba0271b087312f6117b824af272bedd4ee969d52363a86b
案例2:已经安装了Google Repo,仍然想知道出了什么问题?
将PATH=~/bin:$PATH
添加到文件~/.bashrc的末尾,然后运行source ~/.bashrc
。
您仍需要安装repo。repo是建立在git之上的第三方工具。请参见http://source.android.com/source/downloading.html了解如何安装。
chmod +x repo
。 - Chef Pharaoh我有同样的问题,每次使用repo sync命令时都需要执行$ PATH=~/bin:$PATH
,但至少它可以正常工作。
将 PATH=~/bin:$PATH
添加到文件 ~/.bashrc
中
编辑 .bash_profile 文件并取消注释这些字段。(任何文本编辑器都可以)
# Set PATH so it includes user's private bin if it exists
# if [ -d "${HOME}/bin" ] ; then
# PATH="${HOME}/bin:${PATH}"
# fi
重新启动CYGWIN。
这是关于 Android 构建系统错误的解答 针对 Python 3
如果你遇到了 "/usr/bin/env 'python' no such file or directory" 的错误信息,请使用以下解决方案之一: 如果你的 Ubuntu 20.04.2 LTS 是新安装的(而不是升级的)Linux 版本:
sudo ln -s /usr/bin/python3 /usr/bin/python
repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M
你可以在 下载源代码 中查看文档
检查并查看您的工作目录中是否同时拥有.profile和.bash_profile文件。
如果是这样,可能是两个文件中的导出命令在您的shell中发生了冲突。这可能会使Windows中的输出看起来像这样...
PATH="C:/Windows/path/to/repo/Windows/path/to/repo:$PATH"
export PATH
这就是发生在我的Bash shell上的事情。虽然这2个文件与Bash或Cygwin的交互方式不同,但如果您有冗余输入,则它们将一起编译...