rosdep init失败

安装ros时,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.

首先检查是否联网;

如果可以正常上网,还是报错,检查有没有文件夹/etc/ros/rosdep/sources.list.d,如果没有,sudo mkdir创建一下,然后在该文件夹下创建文本,sudo gedit 20-default.list,把下面的内容都复制粘贴进去

# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
 
# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
 
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

接下来,rosdep update还是会失败,因为以上网址都被墙了,搜了一下,按照以下步骤操作:

sudo gedit /etc/hosts

在打开的文本最后加上一行:

151.101.84.133  raw.githubusercontent.com

重新执行rosdep update即可

你可能感兴趣的:(rosdep init失败)