针对这个问题在网上找了很多方法,大部分都说是网络原因,要么使用加速器上网(你懂得),要么用手机热点,还有就是非常麻烦的通过修改rosdep中的python代码,使其能够跳过网站验证,大多数的博客都是一样的,最终没有解决问题。
这里我提供两种方法,建议使用方法一。
方法一:
sudo apt-get install python3-pip
sudo pip3 install rosdepc
sudo rosdepc init
rosdepc update
方法二:
连上加速器,直接在chrome浏览器输入这个链接:https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
发现是一个文本文件,既然下载不了,那就自己建立一个,建立文件夹
sudo mkdir -p /etc/ros/rosdep/sources.list.d
然后复制以下内容:
# os-specific listings first
yaml https://raw.github.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
# generic
yaml https://raw.github.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.github.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.github.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.github.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
将以上内容粘贴写入文件文件中
sudo gedit 20-default.list
保存并退出,接着修改host文件
#打开hosts文件
sudo gedit /etc/hosts
#在文件末尾添加
151.101.84.133 raw.githubusercontent.com
#保存后退出再尝试
重启网络
sudo /etc/init.d/networking restart
这时候应该就可以解决了,如果还是不行到这一步后切换手机热点再试一下应该就没问题了