这种问题一般是应该下载的文件下载不下来,所以就查看文件内容,自己创建一个。 新建文件:
sudo gedit /etc/ros/rosdep/sources.list.d/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如果还是有问题,在浏览器访问网址 https://site.ip138.com/raw.Githubusercontent.com/
输入raw.githubusercontent.com 会出现几个网址,选择一个,我选择151.101.76.133 修改hosts
sudo gedit /etc/hosts增加 151.101.76.133 raw.githubusercontent.com 然后再
rosdep update如果再出现问题,那都是网络问题,多试几次,有线网,手机热点。 参考:https://www.cnblogs.com/polipolu/p/12836331.html