目录
问题1:ERROR: default sources list file already exists:
主要问题描述:
在使用ros时,出现了一个警告“the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'”,虽然不影响使用,但是看得很闹心。
原因:
未知。目前产生原因还没有一个定论,就看做是一个小点的bug吧。问题不大
好像因为是最近update抽风了,无数的人都出现问题了,安装ros也失败了。
解决方法:
依次运行以下代码
$ sudo apt-get update
$ sudo apt-get install python-rosdep
$ sudo rosdep init
$ rosdep update
很小的概率能一次成功。可能会出现各种稀奇古怪的问题,下面就各种问题进行一个总结。
问题1:ERROR: default sources list file already exists:
ERROR: default sources list file already exists:
/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
原因:
20-default.list已经存在,需要删除。
解决方法:
运行以下代码,再运行sudo rosdep init
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
问题2: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.
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.
原因:
报错原因是GitHub的raw.githubusercontent.com无法连接
需要解决GitHub的raw.githubusercontent.com无法连接问题
解决方法:
通过IPAddress.com首页,输入raw.githubusercontent.com查询到真实IP地址
如:
修改hosts Ubuntu,记下查找到的任意ip,执行:
sudo vi /etc/hosts
在底部添加以下内容保存即可
185.199.108.133 raw.githubusercontent.com
然后输入sudo rosdep init就可以了
若依旧下载不了,则替换为:
199.232.28.133 raw.githubusercontent.com
151.101.228.133 raw.github.com
问题3:rosdep update一直timeout
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit http://github.com/ros/rosdistro/raw/master/rosdep/osx-homebrew.yaml
ERROR: unable to process source [http://github.com/ros/rosdistro/raw/master/rosdep/base.yaml]:
<urlopen error _ssl.c:489: The handshake operation timed out> (http://github.com/ros/rosdistro/raw/master/rosdep/base.yaml)
ERROR: error loading sources list:
The read operation timed out
原因:
链接超时,可能是网络波动,或者其他莫名的原因
解决方法:
方法1:
sudo gedit /etc/resolv.conf
将原有的name注释掉,再添加上
nameserver 8.8.8.8
nameserver 8.8.4.4
如果上述方法不管用,则尝试方法2
方法2:
更改 /usr/lib/python2.7/dist-packages/rosdep2/
下的三个文件sources_list.py
、gbpdistro_support.py
、rep3.py
中的DOWNLOAD_TIMEOUT = 15.0
值,修改为115或者更大
$ sudo vim /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
$ sudo vim /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
$ sudo vim /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
再运行rosdep update就可以了。
方法3:
手机开热点,或者或者换个网络
方法4:
由于最近update实在没招,所以只能另辟蹊径了
找到一个相同版本已经安装好ros的电脑。
复制 /etc/ros/rosdep/sources.list.d/20-default.list 文件到相同位置
复制 .ros/rosdep/sources.cache/ 内的文件到相同位置
可以启动小乌龟,是可以用的。