标题@ROS安装过程中执行“sudo rosdep init”出现报错。
ROS安装过程中执行“sudo rosdep init”出现报错
ROS安装过程中执行“sudo rosdep init”出现报错,具体示例分析
1.我使用的是ubuntu18.04,安装的是ROS-Melodic,在执行到“sudo rosdep init”命令时报错,报错显示“ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.”这种错误在安装ROS时经常会遇到,我也遇到了,有很多解决方法,我这里就用我的成功案例。
2.解决方法
执行:sudo gedit /etc/hosts命令,打开文件hosts文件,在最后一行添加 185.199.108.133 raw.githubusercontent.com,保存后关闭,再重新执行:sudo rosdep init命令后,回车发现成功了。
关于185.199.108.133 raw.githubusercontent.com中185.199.108.133这串数字在怎么有效获取,可以进入"https://www.ipaddress.com/site/raw.githubusercontent.com"网站去找raw.githubusercontent.com的有效地址,"https://www.ipaddress.com/site/raw.githubusercontent.com"这个是去获取有效的ip地址,
先在搜索栏输入“raw.githubusercontent.com”点击搜索
搜索后可以找到世界上“raw.githubusercontent.com”的有效ip地址,如下图: 185.199.108.133, 185.199.109.133, 185.199.110.133 and 185.199.111.133 ,这四个都可以,我就复制了第一个185.199.108.133到我前面打开的hosts文件的最后一行,保存后再次执行:sudo rosdep init命令,发现成功了,
!](https://img-blog.csdnimg.cn/fc17f009113944b183749b4954b4369c.png)
参考连接:https://blog.csdn.net/mahoon411/article/details/119610463