rosdep update read operation time out 不用科学上网的解决方法(亲测可用)

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

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

一、如果有条件无线网尝试连接手机热点update

二、根本解决方法

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

  2. 查找文件/usr/lib/python2.7/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.7/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步中的路径,

  5. 比如我修改后的文件:

    #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了。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Al资料站与复盘笔记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值