VWware虚拟机中的使用记录 —— 在ubunut18.04安装ROS时更新报错:The read operation timed out的解决方法

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档


前言

在ROS中,执行rosdep update时可能遇到“read operation timed out”的错误,提示超时问题。这通常由网络连接不稳定、DNS解析失败或防火墙限制等原因引起。解决方法包括检查网络连接、更换DNS服务器、配置代理或使用VPN等。手动更新源列表也是一种应对方法。通过这些步骤,通常可以解决该问题,确保ROS的正常运行。

一、rosdep update 更新报错:read operation timed out

1. 问题描述

在安装ros时,使用rosdep update指令进行更新时,出现报错:更新超时(read operation timed out),具体的信息如下所示:

reading in sources list data from /etc/ros/rosdep/sources.list.d
ERROR: unable to process source
[https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml:
<urlopen error timed out (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: error loading sources list:(‘The read operation timed out’,)

报错的信息截图如下所示:

在这里插入图片描述

2. 原因分析

raw.githubusercontent.com这个网站被墙,导致超时

3. 解决

(1) 科学上网,再次执行更新的指令

(2) 手动下载rosdep update所需的文件
将更新所需要的文件下载放在本地文件夹,并修改执行更新的路径。在本地完成更新。具体步骤如下:
1)本地下载更新所需要的文件
百度网盘的链接如下:

链接: https://pan.baidu.com/s/1_svhixikbatyeiIUrkC4Xw
提取码: r6tb

2)将提取出的文件夹移动到/etc/ros文件夹下

在这里插入图片描述

3) 修改更新文件路径
① 修改index-v4.yaml路径:
终端输入:

sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py

将该文件中第68行代码注释并添加

file:///etc/ros/ros_github/index-v4.yaml

添加位置如下图所示:
在这里插入图片描述
② 修改/etc/ros/rosdep/sources.list.d/20-default.list文件
终端输入:

sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list

再将原有内容全部注释 。最后添加以下内容在文档中:

在这里插入图片描述
(3) 再次执行rosdep update
若显示如下信息,则表示rosdep update成功:
成功的提示信息:

reading in sources list data from /etc/ros/rosdep/sources.list.d Hit
file:///etc/ros/ros github/osx-homebrew.yaml Hit file:///etc/ros/ros
github/base.yaml Hit file:///etc/ros/ros github/python.yaml Hit
file:///etc/ros/ros github/ruby.yaml Hit file:///etc/ros/ros
github/fuerte.yaml Query rosdistro index file:///etc/ros/ros
github/index-v4.yaml Skip end-of-life distro “ardent” Skip end-of-life
distro"bouncy" Skip end of-life distro “crystal” Add distro “dashing”
Add distro “eloquent” Add distro “foxy” Skip end-of-life distro
“groovy“ Skip end-of-life distro"hydro” Skip end-of-life distro
“indigo” Skip end-of-life distro “jade” Add distro “kinetic” Skip
end-of-life distro "lunar” Add distro “melodic” Add distro “noetic”
Add distro “rolling” updated cache in
/home/chen/.ros/rosdep/sources.cache

页面如下:
在这里插入图片描述
以上就是在ubunut18.04安装ROS时更新报错:The read operation timed out的问题的全部解决过程,有什么问题。可以评论区留言讨论交流!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值