rosdep update 失败的解决方案汇总(已解决)

rosdep update 失败的一系列解决方案

在本文的开头提出一点建议:换其他方法时,最好将上一个方法改过的文件再改回来……

1. 更换网络

如换为手机热点等,Ctrl+C多试几次,有些同学换了网络就可以直接成功。

2. 修改host文件,添加网址IP

1.打开查询ip的网址:
https://site.ip138.com
2.输入:
raw.githubusercontent.com
查询ip添加到host文件,合适的IP如:

151.101.84.133 raw.githubusercontent.com

在终端输入

sudo gedit /etc/hosts

添加查到的ip地址,保存并关闭文档,重新update。
我的问题是,查询不到……好象是DNS之类的问题?

3. 更改TIMEOUT时间

sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py

更改/usr/lib/python2.7/dist-packages/rosdep2/下的三个文件 sources_list.py、gbpdistro_support.py、rep3.py 中的 DOWNLOAD_TIMEOUT 的值。
打开文件后,找到DOWNLOAD_TIMEOUT,将其后的值改大即可。

4. 创建并修改20-default.list文件(init)

sudo mkdir -p /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list
# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/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
 
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

5. 修改镜像源(这个应该是init的解决方式)

镜像

6. 修改rosdep源码

直接放参考链接:
ros
aa

7. 修改/usr/lib/python2.7/dist-packages/rosdistro/init.py文件参考链接:

https://blog.csdn.net/super_sean/article/details/105433250中的(3)

# index information
#DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'file:///etc/ros/rosdistro/master/index-v4.yaml'

8. 将文件下载到本地

https://blog.csdn.net/super_sean/article/details/105433250中的(2)
发现主要在打开20-default.list里的链接时失败,也就是无法下载20-default.list列举的几个配置文件。故,把这些文件下载到本地,然后修改20-default.list脚本文件:
a.将20-default.list中的链接在浏览器中打开,然后在了/etc/ros/建相应的目录结构和文件。
b.修改20-default.list脚本文件。

#os-specific listings first
#yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml file:///etc/ros/rosdistro/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 file:///etc/ros/rosdistro/master/rosdep/base.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/python.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro file:///etc/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

9. 修改DNS服务器地址

这个方法我尝试的不多,uu们可以多多尝试。
https://blog.csdn.net/super_sean/article/details/105433250
文中的(4)
https://zhuanlan.zhihu.com/p/136014044
文中的(2)
Ubuntu修改DNS
可怜我尝试了以上各种方法,仍没update成功,文章持续更新中……我要做各种方法总结的最全的仔!(要不是update不成功谁又愿意这样呢嘤嘤嘤)
希望你尝试了文中的一些方法就成功了(这是世间最诚挚的祝愿了

最后,愿,平安喜乐

更新:
成功了!成功了!修改了DNS后又把文件下载到本地,然后哪里不对,hit不成功,就把哪个网站下载到本地,通过命令:

sudo gedit 20-default.list

20-default.list文件一通魔改,成功了!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值