运行 sudo apt update的时候出现下面的错误:
Err:11 http://packages.ros.org/ros2/ubuntu xenial InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
或者:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.ros.org/ros2/ubuntu focal InRelease: The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal Release: The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>
W: Failed to fetch http://packages.ros.org/ros2/ubuntu/dists/focal/InRelease The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/dists/focal/Release.gpg The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <info@osrfoundation.org>
W: Some index files failed to download. They have been ignored, or old ones used instead.
试了一些办法,包括
sudo apt-key del F42ED6FBAB17C654
显示是ok,但是update之后还是会提示错误。
试了
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
还是不行。
试了:
curl http://repo.ros2.org/repos.key | sudo apt-key add -
还是不行.
最后解决办法:
ROS1:
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
ROS 2 :
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
然后就ok了。
补充:
raspi4上用的是以下指令:
curl http://repo.ros2.org/repos.key | sudo apt-key add -