1、查看raw.githubusercontent.com的ip地址
可以在Hostname Summary查看raw.githubusercontent.com的ip地址.如图
2、配置host文件
sudo gedit /etc/hosts
加入
185.199.110.133 raw.githubusercontent.com
185.199.110.133 raw.github.com
以上步鄹可以解决如下问题
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.
2.1 执行rosdep init
rosdep init
*当rosdep init
以后在rosdep update
过程中会遇到下载问题
3、修改sources.list.d的访问方式
3.1 使用wget下载需要的文件
wget https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
wget https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
wget https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
wget https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
wget https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
wget https://raw.githubusercontent.com/ros/rosdistro/master/melodic/distribution.yaml
wget https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
3.2 改变sources.list.d中的下载方法
# os-specific listings first
yaml file:///home/lvrobot/osx-homebrew.yaml osx
# generic
yaml file:///home/lvrobot/base.yaml
yaml file:///home/lvrobot/python.yaml
yaml file:///home/lvrobot/ruby.yaml
gbpdistro file:///home/lvrobot/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
3.3 修改osdep2/sources_list.py
在 sources_list.py中加入
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
以上可以解决rosdep update
下载问题
4、执行
rosdep update
- 切记要多次尝试