rosdep update read operation time out 不用翻墙的解决方法

在安装ros时,运行 rosdeo update,因为网络原因,一直出现超时错误:

 rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
ERROR: error loading sources list:
    The read operation timed out

原因不想考究了,大家应该都知道。下面详细说下解决方法:

1、git clone https://github.com/ros/rosdistro.git 到本地,记住这个rosdistro目录的路径,例如我git clone 到了路径 /home/robot/rosdistro/

2、查找 文件/usr/lib/python2/dist-packages/rosdep2/rep3.py 中的raw.githubusercontent.com,将    https://raw.githubusercontent.com/ros/rosdistro/master 替换成 file://+第1步中的路径,比如我的是:

将 原来文件中的 REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml' 替换成 REP3_TARGETS_URL = 'file:///home/robot/rosdistro/releases/targets.yaml'

3、同第2步,查找文件/usr/lib/python2/dist-packages/rosdistro/__init__.py中的raw.githubusercontent.com,将    https://raw.githubusercontent.com/ros/rosdistro/master 替换成 file://+第1步中的路径,比如:

将 原来文件中的 DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'替换成 DEFAULT_INDEX_URL = 'file:///home/robot/rosdistro/index-v4.yaml'

4、sudo rosdep init 重新生成/etc/ros/rosdep/sources.list.d/20-default.list,将该文件中的所有https://raw.githubusercontent.com/ros/rosdistro/master 也替换成 file://+第1步中的路径,比如我修改后的文件:

# os-specific listings first
yaml file:///home/robot/rosdistro/rosdep/osx-homebrew.yaml osx

# generic
yaml file:///home/robot/rosdistro/rosdep/base.yaml
yaml file:///home/robot/rosdistro/rosdep/python.yaml
yaml file:///home/robot/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/robot/rosdistro/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

5、然后就可以顺畅的rosdep update了。

 

参考:https://zhuanlan.zhihu.com/p/107218921

 

  • 5
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值