关于ROS安装中出现cannot download default sources list from的一个解决办法

问题

在安装ROS过程中初始化rosdep:

sudo rosdep init
rosdep update

经常会出现问题:

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.

意思是初始化时不能访问这个网址,我在浏览器中访问了这个网址,时而能时而不能,但最终只要将20-default.list中的内容获取到并放到相应 的位置,经能够绕开rosdep init这个步骤。

解决步骤

  1. 首先创建路径,并定位到该目录:
sudo mkdir -p /etc/ros/rosdep/sources.list.d
cd /etc/ros/rosdep/sources.list.d
  1. 创建文件——20-default.list:
sudo gedit 20-default.list
  1. 将https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list中的内容复制粘贴到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

保存,关闭文件。

  1. 直接更新:
rosdep update

若不成功,一定要连手机热点,还不成功多试几次。

你可能感兴趣的:(关于ROS安装中出现cannot download default sources list from的一个解决办法)