安装 ROS 2 的问题“E:无法找到包 ros-foxy-desktop”

Posted

技术标签:

【中文标题】安装 ROS 2 的问题“E:无法找到包 ros-foxy-desktop”【英文标题】:Problem with instalation ROS 2 "E: Unable to locate package ros-foxy-desktop" 【发布时间】:2021-09-22 01:10:29 【问题描述】:

我尝试在 ubuntu focus fosa (20.04) 上安装 ROS 2。

I went along with this instruction,但是 执行此命令后:

sudo apt update

我遇到了这个问题:

Hit:1 http://ru.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://ru.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                       
Hit:3 http://ru.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                                                   
Hit:4 http://download.opensuse.org/repositories/home:/Alexx2000/xUbuntu_20.04  InRelease                                                                              
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                                                      
Hit:6 http://packages.osrfoundation.org/gazebo/ubuntu-stable focal InRelease                                       
Get:7 http://packages.ros.org/ros2/ubuntu focal InRelease [4,670 B]
Err:7 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
Reading package lists... Done
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.

然后:sudo apt install ros-foxy-desktop

我明白了:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ros-foxy-desktop

【问题讨论】:

【参考方案1】:

我修好了。基本上,我添加了新的存储库密钥并删除了旧的。这对我有用:

https://answers.ros.org/question/379190/apt-update-signatures-were-invalid-f42ed6fbab17c654/

【讨论】:

【参考方案2】:

请验证 ros-latest.list:

sudo gedit /etc/apt/sources.list.d/ros-latest.list

输出:deb http://packages.ros.org/ros/ubuntu focal main

另外,别忘了运行sudo apt update

这对我有用。

【讨论】:

以上是关于安装 ROS 2 的问题“E:无法找到包 ros-foxy-desktop”的主要内容,如果未能解决你的问题,请参考以下文章

机器人操作系统(ROS)入门与实践--1

ORB-SLAM2在Ubuntu20上配合ROS编译运行

Ubuntu1604 ROS安装开发学习记录持续更新中

Ubuntu 18.04 版本下安装ROS 系统

Ubuntu 20.04下源码编译安装ROS 2 Foxy Fitzroy

ROS 安装