root@ubuntu:~# curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
gpg: no valid OpenPGP data found.
解决办法:上述命令中有管道符号,curl是个类似下载的命令,因此尝试将上述命令分开两步执行,
1、
curl -O https://bazel.build/bazel-release.pub.gpg
该命令执行后会在当前目录下保存一个名称为bazel-release.pub.gpg的文件。
curl: (7) Failed to connect to bazel.build port 443: Connection refused
报错直接将链接粘到到浏览器,贴到当前路径后再下一步
2、使用apt-key命令加载获取到的文件
apt-key add bazel-release.pub.gpg
参考资料:https://blog.csdn.net/wiborgite/article/details/52840371