安装ROS:sudo rosdep init报错,ERROR: cannot download default sources list from:

1.ubuntu18.04安装ROS

一开始我是直接找安装说明的博客,后来发现还是有不少问题的,就比如秘钥的问题,很有可能不一样。但是官网的一定是准确的,所以以后安装还是参考官网比较好。
http://wiki.ros.org/melodic/Installation/Ubuntu

2.初始化 rosdep init 报错

感谢知乎文章https://zhuanlan.zhihu.com/p/77483614

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.

这个问题真的把我坑惨了,也是因为这个问题,让我下定决心写博客记录自己踩过的坑.....
我搜了好多方法来解决这个问题,现在大致总结如下:

(1) ca-certificates证书的问题,需要重新安装

sudo apt-get install ca-certificates

(2) 还是ssl certs问题

sudo c_rehash /etc/ssl/certs 
sudo -E rosdep init

(3) 发现还是有问题

然后我连上VPN,直接在chrome浏览器输入这个链接:https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
发现是一个文本文件,既然下载不了,那就自己sudo建一下
全程sudo,建立一个文件夹/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

完事再进行下一步,
rosdep update

3.rosdep update报错

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](http://jump.bdimg.com/safecheck/index?url=rN3wPs8te/pX/RXZrrwmgz1HhLKFfuYdBR6elVnGSRMPTZwDs+V1Iw2DN2GIDg0c0lXFaWYCi6F5eugIuTik7Xf24HznH1heOw2gAEfI/e4pyVgDjNm3SaoaxT39lV2h1C6ZRqu3Ohsi0ZhQy1cgW5DaxsU0VVq099hJLALtyPraHkhVQYEleySdzQDlWLfuyu4YXs62n7WWp87t6F1nMhvv0JflI+P2dj2oeHoEzTI=)]:
<urlopen error _ssl.c:495: The handshake operation timed out> ([https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml](http://jump.bdimg.com/safecheck/index?url=rN3wPs8te/pX/RXZrrwmgz1HhLKFfuYdBR6elVnGSRMPTZwDs+V1Iw2DN2GIDg0c0lXFaWYCi6F5eugIuTik7Xf24HznH1heOw2gAEfI/e4pyVgDjNm3SaoaxT39lV2h1C6ZRqu3Ohsi0ZhQy1cgW5DaxsU0VVq099hJLALtyPraHkhVQYEleySdzQDlWLfuyu4YXs62n7WWp87t6F1nMhvv0JflI+P2dj2oeHoEzTI=))
Hit [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml](http://jump.bdimg.com/safecheck/index?url=rN3wPs8te/pX/RXZrrwmgz1HhLKFfuYdBR6elVnGSRMPTZwDs+V1Iw2DN2GIDg0c0lXFaWYCi6F5eugIuTik7Xf24HznH1heOw2gAEfI/e64EpZhV/nSSfaMCRlMqNMjqsw5JFtciolkdT5HNLb22Z8xZQwNWZn8DhrNz7QOmul3vNSiiiuylvEgZ+MKQ61lxfjiJ1xO6k1T0sjgIIm+zjA8Zu4mdgY0)
ERROR: error loading sources list:
The read operation timed out

解决办法如下

sudo apt-get update
sudo apt-get install python-rosdep
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容