博主使用的是Ubuntu18.04.6LTS版本,ROS安装出现错误环节:
sudo rosdep init
rosdep update
把遇到的坑记录下,如果针对某个报错尝试后还是update失败,那就把本文的方法都尝试一遍,本人亲册成功了的,自认为我是全网能搜到的坑真的都碰见了[笑哭]!关于切换手机热点的方法整个ROS安装过程中我全程不好使,问题汇总:
ERROR: unable to process source && cannot download default sources list from:
ERROR: errorr loading sources list: The read operation timed out
sudo: rosdep:找不到命令
原因定位:缺少python-rosdep
解决方法:利用apt-get安装相应的包即可
sudo apt-get install python-rosdep
参考文献:https://blog.csdn.net/qq_38337524/article/details/108817398
ERROR: unable to process source && cannot download default sources list from:
原因定位:估计是被墙了
解决方法1: 利用gedit编辑文件,添加备选IP;
sudo gedit /etc/hosts
127.0.0.1 localhost
127.0.1.1 zhang
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#添加备选IP:
185.199.111.133 raw.githubusercontent.com
#185.199.111.133 raw.githubusercontent.com
#185.199.108.133 raw.githubusercontent.com
#185.199.109.133 raw.githubusercontent.com
#185.199.110.133 raw.githubusercontent.com
#199.232.28.133 raw.githubusercontent.com
#151.101.76.133 raw.githubusercontent.com
# GitHub Start
67.227.226.240 raw.githubu.com
52.74.223.119 github.com
192.30.253.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
151.101.76.133 raw.githubusercontent.com
151.101.108.133 user-images.githubusercontent.com
151.101.76.133 gist.githubusercontent.com
151.101.76.133 cloud.githubusercontent.com
151.101.76.133 camo.githubusercontent.com
151.101.76.133 avatars0.githubusercontent.com
151.101.76.133 avatars1.githubusercontent.com
151.101.76.133 avatars2.githubusercontent.com
151.101.76.133 avatars3.githubusercontent.com
151.101.76.133 avatars4.githubusercontent.com
151.101.76.133 avatars5.githubusercontent.com
151.101.76.133 avatars6.githubusercontent.com
151.101.76.133 avatars7.githubusercontent.com
151.101.76.133 avatars8.githubusercontent.com
# GitHub End
解决方法2:创建sources.list.d文件,编辑保存,然后rosdep update
sudo mkdir /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
参考文献:https://blog.csdn.net/qq_43153603/article/details/107222227
结论:经过上述操作,rosdep update还是失败!!!别急,不行就继续下面的操作!
ERROR: errorr loading sources list: The read operation timed out
问题原因:解决超时问题就把超时时限设置的大一点
解决方法:更改以下3个文件的时限内容
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py、
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py、
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
# seconds to wait before aborting download of gbpdistro data
# DOWNLOAD_TIMEOUT = 15.0
DOWNLOAD_TIMEOUT = 50.0
结论:本人尝试后没用,大家也可参考下。而且设置大了还会出现新的问题,忘记截图保存下来了,网上也有人成功的。
参考文献:https://www.cnblogs.com/zxzmnh/p/11758103.html
rosdep update还是失败的终极解决方法
问题原因:rosdep update过程说白了其实就是没有能够正常从我们配置的source源获取到所需要的文件,所以提供的方法就是把文件提前下载到本地,然后使update过程链接到文件就行了!
解决方法:
1、下载文件并解压rosdistro下载,rosdistro文件夹放到/etc/ros/目录下
2、sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list,将下方内容COPY覆盖保存
# os-specific listings first
#yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml file:///etc/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
yaml file:///etc/ros/rosdistro/master/rosdep/base.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/python.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro file:///etc/ros/rosdistro/master/releases/fuerte.yaml fuerte
#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
3、sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py,更改DEFAULT_INDEX_URL保存
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
# index information
#DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'file:///etc/ros/rosdistro/master/index-v4.yaml'
参考文献:https://blog.csdn.net/super_sean/article/details/105433250#commentBox
至此,rosdep update终于成功了,搞了尼玛一天!!!
温馨提示:rosdep update执行失败的时候,一定卡掉多重复几次!!!