我是按照https://docs.bazel.build/versions/master/install-ubuntu.html#install-with-installer-ubuntu上的说明
并试图在Ubuntu上安装bazel。
当我运行步骤2:sudo apt update && sudo apt install bazel
时
我得到:
Get:1 https://storage.googleapis.com/bazel-apt stable InRelease [2,256 B]
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Err:1 https://storage.googleapis.com/bazel-apt stable InRelease
The following signatures were invalid: EXPKEYSIG 3D5919B448457EE0 Bazel Developer (Bazel APT repository key) <bazel-dev@googlegroups.com>
Hit:5 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
W: GPG error: https://storage.googleapis.com/bazel-apt stable InRelease: The following signatures were invalid: EXPKEYSIG 3D5919B448457EE0 Bazel Developer (Bazel APT repository key) <bazel-dev@googlegroups.com>
E: The repository 'https://storage.googleapis.com/bazel-apt stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
有人知道怎么解决这个问题吗?
发布于 2020-05-24 19:38:20
Bazel Ubuntu PPA密钥已过期。
来自https://github.com/bazelbuild/bazel/issues/11470#issuecomment-633205152
您可能必须使用新键手动更新apt键: $ curl https://bazel.build/bazel-release.pub.gpg \ sudo sudo apt-key add -$sudo apt-获取更新
发布于 2020-09-24 08:26:14
尝试使用Bazelisk安装Bazel,如下所示:
cd ~
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64
chmod +x bazelisk-linux-amd64
sudo ln -s ~/bazelisk-linux-amd64 /usr/bin/bazel
bazel version
发布于 2022-06-06 15:09:16
Bazel更新了gpg公钥,但是由于网络缓存https://bazel.build/bazel-release.pub.gpg仍然可能返回旧密钥,
请使用以下命令更新本地计算机上的公钥:
curl -fsSL https://storage.googleapis.com/www.bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
mv bazel-archive-keyring.gpg /usr/share/keyrings/
参考资料:https://github.com/bazelbuild/bazel/issues/15558#issuecomment-1136150886
https://stackoverflow.com/questions/61982500
复制相似问题