错误提示
在按照官方网站提示
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
出现错误提示:
gpg: 找不到有效的 OpenPGP 数据。
且此时直接访问 https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc 也失败。原因可能是DNS干扰。
解决办法
此时可以使用 https://www.ipaddress.com/ 查询https://raw.githubusercontent.com的IP地址。若出现了下图,可更换浏览器查询、切换至windows系统查询、使用其他设备查询。并将IP地址写入到系统设置内。
笔者使用swichHosts软件直接统一管理host文件,故此处不再说明如何设置系统设置。
此时,直接访问 https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc 可以看到密钥内容。说明可以正常链接。
再次执行命令即可。
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
经验之谈,请各位批评指正!