Ubuntu 20官方仓库没有bazel这个编译工具,可以通过如下方式安装:
设置bazel的镜像源
sudo apt install curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
安装bazel
sudo apt update && sudo apt search bazel
# 选择合适的版本进行安装
sudo apt install bazel-4.2.2
# 创建符号链接
mkdir ~/bin
ln -s /usr/bin/bazel-4.2.2 ~/bin/bazel
官方资源:
https://www.bazel.build/