rosdep init ROS安装问题解决方案
时间:2023-03-12 11:13 来源:网络整理 作者:默认发布 点击:次
操作系统:Ubuntu18.04 ROS版本:melodic 笔者在很长一段时间里,由于自身电脑问题,只能通过VMWare软件安装Ubuntu操作系统的虚拟机进行ROS相关的学习与应用,并偶然并多次的发现安装完系统后,进行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.却发现其实通过终端ping的方式,我们是可以访问上述网页地址的 如果你正遇到这个问题,那么第一个解决方案就是,更换网络,你可以尝试使用你的手机热点,然后继续尝试以下指令,如果你成功了,那么你可以结束本文章的阅读,当然欢迎你继续阅读。 sudo rosdep init rosdep update 解决方案0x02该解决方案是针对由于以下两个无法正常访问,但可以ping通,于是修改hosts文件,加入以下两个网址的IP地址实现访问。 sudo gedit /etc/hosts 199.232.28.133 raw.githubusercontent.com 151.101.228.133 raw.github.com修改完成后,在终端执行 sudo rosdep init rosdep update 解决方案0x03如果使用解决方案0x01仍然无法解决你的问题,那么你可以尝试以下步骤,此解决方案的原理是基于手动完成sudo rosdep init的步骤,然后再通过rosdep update完成整个方案的实施。 步骤一:首先打开一个终端,执行以下指令创建root并切换至root用户 sudo passwd //接着提示输入UNIX密码,输入你的用户密码即可 sudo su //或者su root 然后输入密码切换至root用户 sudo mkdir -p /etc/ros/rosdep/sources.list.d cd /etc/ros/rosdep/sources.list.d sudo gedit 20-default.list步骤二:将以下内容复制进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步骤三:执行以下指令 exit //退出root用户 rosdep update如果你成功了,那么你可以结束本文章的阅读,当然欢迎你继续阅读。 但也许你会遇到如下图所示的问题,发现20-default.list中的地址都无法连接,此时你可以将20-default.list中的内容替换如下,即将raw.githubusercontent.com替换为raw.github.com后保存文件,在终端中执行 rosdep update (责任编辑:admin) |