The problem encountered during the installation of ROS2-Galactic on ubuntu18.04/Ubuntu20.04 "gpg: no valid OpenPGP data found."

Binary installation reference: https://index.ros.org/doc/ros2/Installation/Dashing/Linux-Install-Debians/
When performing this step:

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

An error occurred:

 curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
[sudo] password for gym: 
gpg: no valid OpenPGP data found.

That is, the connection to raw.githubusercontent.com failed

Solution:
Open the webpage:
https://site.ip138.com/raw.Githubusercontent.com/

Enter raw.githubusercontent.com to query the IP address
insert image description here
Open a terminal and enter the command:

 sudo nano /etc/hosts

Add this sentence at the end of the file:

185.199.109.133 raw.githubusercontent.com

The IP address in the command can be changed according to the IP queried on the web page

おすすめ

転載: blog.csdn.net/Feizhai2/article/details/113914008