解决Ubuntu18.04安装仿真环境下载ROS执行sudo rosdep init无法下载文件的问题

发布于 2021-01-03  440 次阅读


错误信息如下:

ganahe@ganahe-virtual-machine:~/Downloads$ 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.

法一、在浏览器直接访问:

# 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

随后手动创建文件即可!

法二、更新Host(推荐!):

#打开hosts文件
sudo gedit /etc/hosts
#在文件末尾添加
151.101.84.133  raw.githubusercontent.com
#保存后退出

再执行:

sudo rosdep init
# fix-permission限制权限为当前用户
sudo rosdep fix-permissions
# 可能由于网络原因会失败,多运行几次即可
rosdep update