ubuntu安装ROS运行rosdep init错误,cannot download default sources list from....

rosdep init 或者rosdep update 连接错误的解决办法

$ 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.

上述链接通过浏览器也不能访问

解决方法1

变更nameserver为google服务器

sudo gedit /etc/resolv.conf

将原有的nameserver这一行注释,并添加以下两行,二选一也可:

nameserver 8.8.8.8 #google域名服务器
nameserver 8.8.4.4 #google域名服务器

保存退出,执行

$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
   
       rosdep update

解决方法2

raw.githubusercontent.com网站不能访问,此时可能是因为被firework墙了。
解决办法是修改hosts文件,添加这个网站的ip地址

打开hosts文件

sudo gedit /etc/hosts

在文件末尾添加

151.101.84.133  raw.githubusercontent.com

保存后退出再尝试

错误2

错误描述:

~$ sudo rosdep init 
ERROR: default sources list file already exists:
/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize

解决办法:

执行以下命令,删除已经存在的初始化文件:

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

然后再重新运行

解决方法3

下载一份20-default.list,放到

/etc/ros/rosdep/sources.list.d/ 下面
运行rosdep update

这时出现部分错误 也可以继续配置完ros环境变量,运行ros。(后续再抽时间更新rosdep)

xx@ubuntu:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]:
	<urlopen error ('_ssl.c:574: The handshake operation timed out',)> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml)
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
ERROR: error loading sources list:
	<urlopen error <urlopen error ('_ssl.c:574: The handshake operation timed out',)> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>

设置环境变量:

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

验证ros安装:

~$ roscore
... logging to /home/xx/.ros/log/8fac7312-bc6c-11eb-944c-000c29629c67/roslaunch-ubuntu-39878.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu:36759/
ros_comm version 1.12.17


SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.17

NODES

auto-starting new master
process[master]: started with pid [39889]
ROS_MASTER_URI=http://ubuntu:11311/

setting /run_id to 8fac7312-bc6c-11eb-944c-000c29629c67
process[rosout-1]: started with pid [39902]
started core service [/rosout]
^C[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

rosdep update运行错误 参考链接
https://blog.csdn.net/c417469898/article/details/106360595

  • 9
    点赞
  • 64
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
### 回答1: 错误:无法从https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list下载默认源列表,网站可能已关闭。 ### 回答2: sudo rosdep init命令是ROS(机器人操作系统)的一个重要功能之一,它用于初始化rosdep,以便后续的软件安装可以正常进行。 然而,如果在执行sudo rosdep init时出现错误,如“cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list website may be down”,我们该怎么办呢? 首先,我们需要了解,这个错误提示表明rosdep无法从https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list下载默认源列表,可能是因为该网站无法访问。 因此,解决方法很简单,我们只需要排除网络连接不良的问题即可。 我们可以在终端中使用ping命令测试与该网站的连接,例如:ping raw.githubusercontent.com。 如果返回的结果表明连接正常,则可以尝试使用以下命令手动下载20-default.list文件: ``` sudo wget https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list -O /etc/ros/rosdep/sources.list.d/20-default.list ``` 这个命令会将20-default.list文件下载到/etc/ros/rosdep/sources.list.d/目录下,然后您可以再次尝试执行sudo rosdep init命令。 如果网络连接正常但是手动下载20-default.list文件仍然失败,则可能是源代码已经被移除或更改了,您可以访问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虽然看起来令人担忧,但通常情况下只要排除网络连接问题就可以解决。 ### 回答3: sudo rosdep init 错误:无法从https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list下载默认源列表。可能无法访问该网站。 这个错误的意思是,在运行sudo rosdep init命令时,系统无法从URL https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list中下载默认源列表。这可能是因为该网站没有上线或被封锁了。这个错误发生的原因有多种可能性,例如网络问题或GitHub服务器故障等。 要解决这个问题,可以尝试以下几种方法: 1. 检查网络连接:首先,确保您的网络连接是正常的,尝试访问其他网站以确认您的网络连接是否正常。 2. 尝试手动下载源列表:使用web浏览器手动下载源列表 https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list。您可以将其下载到本地计算机并将其放置在正确的位置。 3. 更改软件源:您可以更改软件源并使用其他软件源,如阿里云软件源或清华大学TUNA镜像站。这有助于解决与下载软件包相关的问题。 4. 等待一段时间:有时,由于GitHub服务器中断或大量请求,会导致下载源列表时出现问题。在这种情况下,您需要等待一段时间才能再次尝试。 总之,解决sudo rosdep init错误可能需要您尝试多种方法。通过检查网络连接、手动下载源列表或更改软件源等方式,您可以找到适合您的解决方案。同时也需要注意,由于网络问题或服务器故障等原因,您可能会在不同的时间段遇到这个错误
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值