-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Description
While installing ROS 2 Humble packages (e.g., rqt, rqt_graph, and custom packages with rosdep), I encountered an error due to a missing GPG key for the ROS 2 apt repository. This prevented apt from securely updating or installing any ROS packages.
Error Message:
W: GPG error: http://packages.ros.org/ros2/ubuntu jammy 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 jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
Steps to Reproduce
Run sudo apt update on a system with ROS 2 Humble set up using the ROS2 env.
Attempt to install a ROS package using sudo apt install ros-humble-rqt.
Observe the GPG error due to the missing key.
Expected Behavior
apt should securely fetch and install packages from the ROS 2 repository without signature errors.
Actual Behavior
All ROS 2 package installations fail due to a missing repository signature key.
✅ Solution / Fix
Remove old ROS key if it exists
sudo rm /usr/share/keyrings/ros-archive-keyring.gpg
I resolved the issue by manually updating the GPG key using the following commands:
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc \
| sudo gpg --dearmor -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" \
| sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
After running the above steps, I was able to install all ROS 2 packages and dependencies successfully.