天天看点

解决 ros 安装sudo rosdep init 出现 ERROR: cannot download default sources list from: https://raw.githubuse

出现问题:

解决 ros 安装sudo rosdep init 出现 ERROR: cannot download default sources list from: https://raw.githubuse

解决方案:

尝试了好多解决方案,最后总结如下:

在本地新建对应目录/etc/ros/rosdep/sources.list.d

$ sudo mkdir -p /etc/ros/rosdep/sources.list.d
           

并定位到该目录:

$ cd /etc/ros/rosdep/sources.list.d
           

新建文件20-default.list:

$ sudo gedit 20-default.list
           

将上面打开网页中的内容复制粘贴到新建打开的文档中:

# 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
           

保存,关闭文件。

在终端运行:

rosdep update
           

这里如果成功会得到以下信息。

解决 ros 安装sudo rosdep init 出现 ERROR: cannot download default sources list from: https://raw.githubuse

不过到这里,我失败了,得到以下错误,

解决 ros 安装sudo rosdep init 出现 ERROR: cannot download default sources list from: https://raw.githubuse

好处是错误有了变化,继续解决。

sudo gedit /etc/resolv.conf
           

将原有的nameserver这一行注释,并添加以下两行:

nameserver 8.8.8.8 #google域名服务器

nameserver 8.8.4.4 #google域名服务器
           
解决 ros 安装sudo rosdep init 出现 ERROR: cannot download default sources list from: https://raw.githubuse

保存退出,执行

sudo  apt-get update
           
解决 ros 安装sudo rosdep init 出现 ERROR: cannot download default sources list from: https://raw.githubuse

再执行

rosdep update

出现:

解决 ros 安装sudo rosdep init 出现 ERROR: cannot download default sources list from: https://raw.githubuse

可以啦。

成功了之后,可以再改回去,防止以后因为这里出现类似错误。

参考网址:

https://blog.csdn.net/u013468614/article/details/102917569

https://blog.csdn.net/mrh1714348719/article/details/103803110