Hey you all, the recommended solution is not working for me.
I already had
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
as described above in my Docker container’s Dockerfile, but it was failing due to expired keys during installation of ROS packages.
Then I added the line
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
and everything worked.
Unless I’m reading the documentation wrong, it seems that it should work with the first line, and the second line should not be required. Why may I have success only when I add the second line?
To summarize, my failing code is this:
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' >/dev/null 2>&1 \
&& apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
which results in the key error when trying to install ROS packages, but the following code works:
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' >/dev/null 2>&1 \
&& apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
I have a feeling the first line is not needed if I have the second one, but the main issue is that it does not work for me if I use only the first.