参考网站:sudo rosdep init报错raw.githubusercontent.com被down (qq.com)
使用Ubuntu2004安装ROS foxy时遇到了报错:
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.
这个问题困扰了很久,所以在此记录下自己的解决方法。在网上其他的解决方案中也有通过修改文件成功的,跟参考网址解决方法的区别在于foxy使用的是python3-rosdep,
?所以需要修改的文件位于/usr/lib/python3/dist-packages中,我的解决步骤如下:
1.在ubuntu里面打开浏览器去https://github.com/ros/rosdistro,把这个项目下载到/tmp下面,压缩包名为rosdistro-master.zip;
2.将这个压缩包解压到/tmp下面,解压后的文件夹为rosdistro-master;
3.需要修改的文件如下:
/tmp/rosdistro-master/rosdep/source.list.d/20-default.list
/usr/lib/python3/dist-packages/rosdep2/sources_list.py
/usr/lib/python3/dist-packages/rosdep2/rep3.py
/usr/lib/python3/dist-packages/rosdistro/__init__.py
4.需要修改的文件内容与参考网页一样,如下:
4.1 输入sudo gedit /tmp/rosdistro-master/rosdep/source.list.d/20-default.list,将其内容改为如下所示:
# os-specific listings first
yaml file:///tmp/rosdistro-master/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///tmp/rosdistro-master/rosdep/base.yaml
yaml file:///tmp/rosdistro-master/rosdep/python.yaml
yaml file:///tmp/rosdistro-master/rosdep/ruby.yaml
gbpdistro file:///tmp/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
4.2?输入命令sudo gedit /usr/lib/python3/dist-packages/rosdep2/sources_list.py,然后将其中的文件进行注释替换。
#DEFAULT_SOURCES_LIST_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list'
DEFAULT_SOURCES_LIST_URL = 'file:///tmp/rosdistro-master/rosdep/sources.list.d/20-default.list'
4.3?输入命令 sudo gedit /usr/lib/python3/dist-packages/rosdep2/rep3.py,然后将其中的文件进行注释替换。
#REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'
REP3_TARGETS_URL = 'file:///tmp/rosdistro-master/releases/targets.yaml'
4.4?sudo gedit /usr/lib/python3/dist-packages/rosdistro/__init__.py,,然后将其中的文件进行注释替换。
#DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'file:///tmp/rosdistro-master/index-v4.yaml'
5.最后执行下列命令:
sudo rosdep init
rosdep update
|