项目场景:
提示:这里简述项目相关背景:
docker容器里装了ros2,现在sudo apt update显示ros2的清华源密钥过期了
按照教程一键安装docker+ros,在sudo apt update时出现问题,显示ros2所用的清华源已经过期。
问题描述
提示:这里描述项目中遇到的问题:

W: http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: GPG error: http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy InRelease: The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>
E: The repository 'http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu jammy 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.
原因分析:
提示:用的清华源 ROS2 仓库缺少 GPG 公钥,所以 apt 无法验证签名
这个错误提示说明ROS2仓库的GPG密钥已经过期或无效,并且还提示密钥存储在已弃用的/etc/apt/trusted.gpg中。
我们需要重新添加ROS2仓库的GPG密钥,并按照新的方法将其存储在/etc/apt/trusted.gpg.d/目录中,而不是使用已弃用的apt-key方法。
解决方案:
提示:试过很多方法,换源,改gpg都试过,没有结果,使用下面的方法,解决了问题。
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
F42ED6FBAB17C654替换自己的报错中的部分,如下图部分

2万+

被折叠的 条评论
为什么被折叠?



