【ROS2安装记录】解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

本文仅用于记录自己在安装ROS2过程中遇到的问题。

安装版本:Galatic Geochelone (银河象龟)
官方教程:http://docs.ros.org/en/galactic/index.html

修改source list

cd /etc/apt
sudo vim source.list

删除旧的source,并清空 /etc/apt/souce.list.d/下方没用的source

安装中遇到的问题

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

原因:被墙了,无法访问。如果没有通过这一步,接下来在update时会报错:

The following signatures couldn’t be verified because the public key is not available:

W: GPG error: http://packages.ros.org/ros2/ubuntu focal InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
E: The repository ‘http://packages.ros.org/ros2/ubuntu focal 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.

curl 这一步将update时的一个key下载了下载。所以没有加入这个key时,在update时会失败。

解决办法:手动将key下下来

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg

这一步是从网址上下载了ros.key文件,并重命名为ros-archieve-keyring.gpg到指定路径。在浏览器打开这个文件后下载下来,重命名后放到指定路径即可。

接下来就是按照教程用相关的key生成ros2.lists放在了/etc/apt/source.list.d/下方。继续相关安装即可。

猜你喜欢

转载自blog.csdn.net/tfb760/article/details/119601032