Author: Hangzhou Dianzi University-School of Automation-Intelligent Systems and Robot Research Center-Jolen Xie
Q: When installing ROS, an error occurs when using rosdep init.
sudo apt install python-rosdep
sudo rosdep init
rosdep update
Error reported: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.
A: Solution
-
Download the rosdistro package, github download address , go to my code cloud, download faster download address , unzip and put it in
/home/你用户名/
the path -
Modify the files in
rosdistro
this package , that is, modify all the URL addresses pointed to in this file to addresses pointing to local files, which is the address of the downloaded package: The following is an example I modified:rosdep/source.list.d/
20-default.list
rosdistro/rosdep/source.list.d20-default.list
raw.githubusercontent.com
# os-specific listings first yaml file:///home/xxx/rosdistro/rosdep/osx-homebrew.yaml osx # generic yaml file:///home/xxx/rosdistro/rosdep/base.yaml yaml file:///home/xxx/rosdistro/rosdep/python.yaml yaml file:///home/xxx/rosdistro/rosdep/ruby.yaml gbpdistro file:///home/xxx/rosdistro/releases/fuerte.yaml fuerte # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
where xxx is your username
-
Modify the following in
/usr/lib/python2.7/dist-packages/rosdep2
the foldersources_list.py
DEFAULT_SOURCES_LIST_URL
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
Modify DEFAULT_SOURCES_LIST_URL path:
DEFAULT_SOURCES_LIST_URL = 'file:///home/xxx/rosdistro/rosdep/sources.list.d/20-default.list'
-
Modify the code in the two folders:
modify file 1sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
Modify URL:
REP3_TARGETS_URL = 'file:///home/xxx/rosdistro/releases/targets.yaml'
Modify file 2:
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
Modify URL:
DEFAULT_INDEX_URL = 'file:///home/xxx/rosdistro/index-v4.yaml'
-
Initialize again
rosdep
. During this period, you may be reminded20-default.list
that it has been downloaded. Just delete it and thenrosdep
it will be fine.sudo rosdep init rosdep update
You can roscore
test whether the installation is successful