ROS的 sudo rosdep init 的报错终极解决方案

Posted 龙翔天地

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ROS的 sudo rosdep init 的报错终极解决方案相关的知识,希望对你有一定的参考价值。

ROS的 sudo rosdep init 的报错解决方案
安装ROS时sudo rosdep init指令报错:

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.

之前在安装ROS 的过程中遇到了 sudo rosdep init报错的问题,搜索了很多教程都无法解决,后来参考了文末的教程亦是无法处理,后来在尝试的过程中意识到之所以安装不成功是因为rosdep对应的安装源在国内无法直接打开,本着自己遇到的问题别人也一定会遇到的原则,坚持搜索,终于在gitee(也可在chinacode中搜索)中找到了相应的源文件,因此参考文末教程,只是在教程最终的文件修改时将原有源链接中(https://raw.github.com/ros/rosdistro/master/)替换为了chinacode中的链接:(https://gitee.com/BlicNet/rosdistro/) 再次尝试按照教程尝试时,问题得以解决,发帖纪念。

1.如果之前已经安装过其他版本ROS 系统的某个版本,按照提示删除已经存在的初始化文件即可:

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

2.重新在/etc目录下添加内容/ros/rosdep/sources.list.d/20-default.list

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

在这里有的电脑可能会出现,mkdir无法创建该包的错误…出现该问题是因为没有相关文件的打开权限,可以用chmod命令获取权限

sudo chmod 777 /etc
  1. 重新执行上述命令打开 20-default.list文件,并将以下内容复制到其中,保存。
# os-specific listings first
yaml https://gitee.com/BlicNet/rosdistro/rosdep/osx-homebrew.yaml osx

# generic
yaml https://gitee.com/BlicNet/rosdistro/rosdep/base.yaml
yaml https://gitee.com/BlicNet/rosdistro/rosdep/python.yaml
yaml https://gitee.com/BlicNet/rosdistro/rosdep/ruby.yaml
gbpdistro https://gitee.com/BlicNet/rosdistro/releases/fuerte.yaml fuerte

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

4.在桌面打开终端执行命令:

rosdep update

问题解决,继续努力吧!

参考链接

链接: https://blog.csdn.net/qq_41058594/article/details/102970901.
链接: https://www.cnblogs.com/JuiceCat/p/12000953.html.

以上是关于ROS的 sudo rosdep init 的报错终极解决方案的主要内容,如果未能解决你的问题,请参考以下文章

ros安装过程中sudo rosdep init报错解决方法

[ros环境]sudo rosdep init报错raw.githubusercontent.com被down的终极解决办法

sudo rosdep init 报错 ERROR:cannot download default sources list from:raw.githubusercontent.com

解决ROS中“sudo rosdep init“和“rosdep update“超时问题的最新方法--2021年最新方法

rosCreate a ROS package:package dependencies报错

rosdep init和rosdep update出错处理