在安装ROS过程中出现
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.
如下所示的情况
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.
解决方法
将相关资源备份到 gitee,修改 rosdep 源码,重新定位资源。
步骤1
进入到 sources.list.d 文件夹(如果没有,则新建)
修改 gedit 20-default.list
cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list
将里面所有的
raw.githubusercontent.com/ros/rosdistro/master
替换成
gitee.com/wybros/rosdistro/raw/master
修改前
# 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
修改后
# os-specific listings first rosdep update
yaml https://gitee.com/wybros/rosdistro/raw/master/rosdep/osx-homebrew.yaml osx
# generic
yaml https://gitee.com/wybros/rosdistro/raw/master/rosdep/base.yaml
yaml https://gitee.com/wybros/rosdistro/raw/master/rosdep/python.yaml
yaml https://gitee.com/wybros/rosdistro/raw/master/rosdep/ruby.yaml
gbpdistro https://gitee.com/wybros/rosdistro/raw/master/releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
步骤2
进入到 rosdep2 文件夹,
修改 gbpdistro_support.py
cd /usr/lib/python2.7/dist-packages/rosdep2/
sudo gedit gbpdistro_support.py
将里面所有的
raw.githubusercontent.com/ros/rosdistro/master
替换成
gitee.com/wybros/rosdistro/raw/master
修改后如下
FUERTE_GBPDISTRO_URL = 'https://gitee.com/wybros/rosdistro/raw/' \
'master/releases/fuerte.yaml'
步骤3
进入到 rosdep2 文件夹,
修改 rep3.py
cd /usr/lib/python2.7/dist-packages/rosdep2/
sudo gedit rep3.py
将里面所有的
raw.githubusercontent.com/ros/rosdistro/master
替换成
gitee.com/wybros/rosdistro/raw/master
修改后如下
REP3_TARGETS_URL = 'https://gitee.com/wybros/rosdistro/raw/master/releases/targets.yaml'
步骤4
进入到 rosdep2 文件夹,
修改 sources_list.py
cd /usr/lib/python2.7/dist-packages/rosdep2/
sudo gedit sources_list.py
将里面所有的
raw.githubusercontent.com/ros/rosdistro/master
替换成
gitee.com/wybros/rosdistro/raw/master
修改后如下
DEFAULT_SOURCES_LIST_URL = 'https://gitee.com/wybros/rosdistro/raw/master/rosdep/sources.list.d/20-default.list'
步骤5
进入到 rosdistro 文件夹
修改 __ init__.py
cd /usr/lib/python2.7/dist-packages/rosdistro/
sudo gedit __init__.py
将里面所有的
raw.githubusercontent.com/ros/rosdistro/master
替换成
gitee.com/wybros/rosdistro/raw/master
修改后如下
DEFAULT_INDEX_URL = 'https://gitee.com/wybros/rosdistro/raw/master/index-v4.yaml'
最后运行rosdep update的命令
sudo rosdep init
rosdep update