ubuntu20.04 ros按装sudo rosdep init ,rosdep update,报错

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)icon-default.png?t=N7T8https://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'

 

  • 7
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值