sudo rosdep init 报错
ERROR: error loading sources list:
<urlopen error <urlopen error [Errno 111] Connection refused> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>
解决方案
查询网址对应IP,并添加到hosts中
IP查询 | IP地址查询 | IP地址 (简体中文) 🔍 (ipshu.com)https://zh-hans.ipshu.com/
将ip添加到hosts中
sudo gedit /etc/hosts
127.0.0.1 localhost
127.0.1.1 leezhao-System-Product-Name
185.199.110.133 raw.githubusercontent.com # 添加此行
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
rosdep update 报错
解决方案
将相关资源备份到gitee
,修改 rosdep 源码,重新定位资源
查找rosdep中和raw.githubusercontent.com相关的内容
find . -type f | xargs grep "raw.githubusercontent"
1.20-default.list
sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list
# os-specific listings first
# yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml https://gitee.com/zhao-xuzuo/rosdistro/raw/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
yaml https://gitee.com/zhao-xuzuo/rosdistro/raw/master/rosdep/base.yaml
yaml https://gitee.com/zhao-xuzuo/rosdistro/raw/master/rosdep/python.yaml
yaml https://gitee.com/zhao-xuzuo/rosdistro/raw/master/rosdep/ruby.yaml
gbpdistro https://gitee.com/zhao-xuzuo/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.__init__.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
# DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'https://gitee.com/zhao-xuzuo/rosdistro/raw/master/index-v4.yaml'
3.gbpdistro_support.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
# FUERTE_GBPDISTRO_URL = 'https://raw.githubusercontent.com/ros/rosdistro/' \
# 'master/releases/fuerte.yaml'
FUERTE_GBPDISTRO_URL = 'https://gitee.com/zhao-xuzuo/rosdistro/raw/master/releases/fuerte.yaml'
4.rep3.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
# REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'
REP3_TARGETS_URL = 'https://gitee.com/zhao-xuzuo/rosdistro/raw/master/releases/targets.yaml'