How to fix APT EXPKEYSIG F42ED6FBAB17C654 Open Robotics

Problem

When trying to update or install packages from the Open Robotics repository, you may encounter an error similar to this:

Err:10 http://packages.ros.org/ros2/ubuntu noble InRelease                                       
  The following signatures were invalid: EXPKEYSIG F42ED6FBAB17C654 Open Robotics <[email protected]>

Solution

To resolve this issue, you need to update the GPG key for the Open Robotics repository. Follow these steps:

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

After that, you can update your package lists and install or upgrade packages as needed:

sudo apt update