ubuntu-18.04 - 带有 ROS 包的“gpg:密钥服务器接收失败:连接被拒绝”
问题描述
我正在尝试在 Ubuntu 18.04 上安装 ROS2。
以下命令给出了没有公钥的错误。
sudo apt update && sudo apt install curl gnupg2 lsb-release
错误:
Hit:1 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:4 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:6 http://packages.ros.org/ros2/ubuntu bionic InRelease [2,565 B]
Err:6 http://packages.ros.org/ros2/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
Reading package lists... Done
W: GPG error: http://packages.ros.org/ros2/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
E: The repository 'http://packages.ros.org/ros2/ubuntu bionic 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.
我尝试了以下方法来获取密钥:
sudo apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 5523BAEEB01FA116
和
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5523BAEEB01FA116
和 y-ppa-manager(“尝试导入所有丢失的 GPG 密钥”)
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get install y-ppa-manager
y-ppa-manager
以上所有方法都给出以下错误
gpg: keyserver receive failed: No keyserver available
我在 Windows 7 主机上使用虚拟机运行 Ubuntu 18.04。
如何使用密钥服务器?
解决方案
您可以从用于夜间构建 osrf/ros2 Docker 映像的 Dockerfile 获取当前工作密钥的副本:https ://hub.docker.com/r/osrf/ros2/dockerfile
# setup ros2 keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
不过,这不是一个面向未来的解决方案,因为我最初为 ROS2 Crystal 使用了不同的密钥,然后该密钥突然停止工作(我们也有自己的常规构建),我得到了和你一样的错误。事实证明,我必须使用新密钥更新我们的构建。
我认为一个更好的解决方案是使用预先构建的 ROS2 环境作为 Docker 镜像。这样,密钥在更新时也会更新。
docker pull osrf/ros2:nightly
推荐阅读
- r - 从 dplyr 中均匀分布的随机样本生成的相同值
- reactjs - 如何在 Gatsby 中实现 Three.js?
- ios - Authorize.net 支付网关 Charge a Credit Card API for iOS swift
- python - 无法通过 Django 的管理页面登录
- spring - 使用“@Scheduled”运行时 getThreadPoolExecutor().getQueue().size() 返回零
- c# - 如何在控制台窗口中使字符串变为粗体?
- java - 访问堆栈顶部元素以递归比较两个堆栈元素是否相同的方法
- javascript - 我循环了 4 个对象并渲染它们的图像,同时根据属性的真实性应用一个类,但有时 DOM 不会重新渲染
- java - java程序中的Unix域套接字描述符泄漏
- mysql - 我们如何在我的 SQL 中获取列表的计数?