初始化 rosdep,出错了别慌,跟着我一步一步走,下面有出错的解决方法
sudo rosdep init
如果显示 sudo: rosdep: command not found
,则运行命令安装依赖
sudo apt install python-rosdep2

之后,大概率出现一下错误:
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.
下面介绍终极方法,保准可以!
① 首先,编辑文件 /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
第 294
行
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
加入这行 url = "https://ghproxy.com/" + url
, 注意缩进

② 修改 sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
在 https://raw.githubusercontent.........
前入 https://ghproxy.com/

③ 以同样的方式在以下文件添加 https://ghproxy.com/
:
件命令 | 行数 |
---|
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py | 第35行 |
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/sources_list.py | 第69行 |
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py | 第39行 |
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/manifest_provider/github.py | 第68行、第119行 |
④ 修改文件 /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
在第206
行添加如下代码
gbpdistro_url = "https://ghproxy.com/" + gbpdistro_url

