【ROS】针对ROS安装过程中出现rosdep update超时问题的解决方法

本文介绍了一种解决rosdepupdate超时问题的方法,通过修改rosdep源码和sources.list.d文件,利用https://ghproxy.com/作为代理加速访问GithubRaw资源,从而避免因国内可用IP减少导致的更新失败。
摘要由CSDN通过智能技术生成

参考:https://blog.csdn.net/leida_wt/article/details/115120940

  • 由于近期国内Github Raw的可用IP越来越少,通过修改hosts文件解决rosdep update超时问题的方法已经不太好用,本文通过修改rosdep源码中下载资源的函数来解决这一问题。
  • 网站https://ghproxy.com/支持github的资源代理,非常好用,我们将用此代理加速rosdep对Github Raw的访问,进而解决rosdep update超时问题。
  1. 首先确定 初始化rosdep 是否成功:sudo rosdep init,是否在如下目录下生成此文件:/etc/ros/rosdep/sources.list.d/20-default.list,若没有,可从其他配置成功的电脑上拷贝过来;
  2. 修改/etc/ros/rosdep/sources.list.d/20-default.list文件:
    在所有https://raw.githubusercontent.com前加上https://ghproxy.com/:如下所示:
# os-specific listings first
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
  1. 修改/usr/lib/python2.7/dist-packages/rosdistro/__init__.py文件:
    DEFAULT_INDEX_URL前面加上https://ghproxy.com/,修改完成如下所示:
DEFAULT_INDEX_URL = 'https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'

按照上述修改完成后,再次尝试执行rosdep update,问题解决!

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值