rosdep update encountered ERROR

created at 06-10-2022 views: 5


rosdep update encounter

ERROR: reading in sources list data from /etc/ros/rosdep/sources.list.d ERROR: unable to process source


The URL that rosdep update needs to access cannot be entered, so an error is reported


When doing rosdep update, visit, which is actually the user data server of github. The rosdep program downloads the yaml file in the package. Therefore, an idea is: first download the package, and change the default url addresses in the following files to the to download files to the local downloaded package the address of.

S1: Download the source code

Go to to download the package. Put it in the /home/xxx directory (ie the home directory)

S2: Modify the code in the 20-default.list file

sudo gedit /home/yourname/rosdistro/rosdep/sources.list.d/20-default.list 

Modify the file 20-default.list under rosdep/source.list.d/ in this package, and change all the url addresses pointing to in this file to the addresses pointing to local files , which is the address of the downloaded package:

# 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

Note: In the py language, the url local file address format is: file://+file address, which is the same when changing the address in other files later.

S3: Modify the code in the file

sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/

Inside the file under the /usr/lib/python2.7/dist-packages/rosdep2 folder. The code in this file accesses, so you can modify the default url.

# default file to download with 'init' command in order to bootstrap
# rosdep
DEFAULT_SOURCES_LIST_URL = 'file:///home/xxx/rosdistro/rosdep/sources.list.d/20-default.list'

# seconds to wait before aborting download of rosdep data

S4: Modify the code in the file

sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/
FUERTE_GBPDISTRO_URL = 'file:///home/xxx/rosdistro/' \

S5: Modify the code in the file

sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/
# location of targets file for processing gbpdistro files
REP3_TARGETS_URL = 'file:///home/xxx/rosdistro/releases/targets.yaml'

# seconds to wait before aborting download of gbpdistro data

S6: Modify the code in the file

sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/
# index information

DEFAULT_INDEX_URL = 'file:///home/xxx/rosdistro/index-v4.yaml'

def get_index_url():

S7: final execution

sudo apt-get update
rosdep update

The result looks like this:


A new and more convenient method was discovered later:

1.Install pip or pip3

sudo apt-get install python3-pip #pip can be changed to pip3

2.Install rosdepc

sudo pip3 install rosdepc


sudo rosdepc init
rosdepc update

4.End (specially recommended)! ! ! !

created at:06-10-2022
edited at: 06-10-2022: