sudo rosdep init ERROR: cannot download default sources list from:
所遇问题描述
按照[http://wiki.ros.org/kinetic/Installation/Source]在ubuntu 16.04上安装ros kinetic,在执行sudo rosdep init命令时出现以下错误:
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.。
使用浏览器直接打开https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list,发现无法打开。
解决方法
使用很多方法之后,依旧无法解决该问题,后发现是hosts的问题,更改hosts即可解决,方法如下
- 在https://laod.cn/hosts/2019-hosts.html中获取hosts,粘贴至剪切板
- 终端输入:sudo gedit /etc/hosts
- 将之前复制hosts内容粘贴在 The following lines are desirable for IPv6 capable hosts上面
- 终端输入sudo /etc/init.d/networking restart,重启网络使hosts生效
- 再次运行sudo rosdep init