When installing ROS, use sudo rosdep init and the error message ERROR: cannot download default sources list from:

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

  1. Download the rosdistro package, github download address , go to my code cloud, download faster download address , unzip and put it in /home/你用户名/the path

  2. Modify the files in rosdistrothis 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.listrosdistro/rosdep/source.list.d20-default.listraw.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

  3. Modify the following in /usr/lib/python2.7/dist-packages/rosdep2the foldersources_list.pyDEFAULT_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'

  4. Modify the code in the two folders:
    modify file 1

    sudo 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'

  5. Initialize again rosdep. During this period, you may be reminded 20-default.listthat it has been downloaded. Just delete it and then rosdepit will be fine.

    sudo rosdep init
    rosdep update
    

You can roscoretest whether the installation is successful

Guess you like

Origin blog.csdn.net/Jolen_xie/article/details/118436834