解决Noetic下rosdep init 与 rosdep update 错误

解决Noetic下rosdep init 与 rosdep update 错误

rosdep init 错误

主要有2个原因:
1、地址污染,需更改hosts。
2、上次下载了20-default.list,影响本次更新。

打开网址,复制hosts。

https://github.com/ineo6/hosts

执行命令,将相关地址复制到里边。

sudo gedit /etc/hosts

切换到以下路径

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

删除以前的20-default.list

sudo rm 20-default.list

再次执行

sudo rosdep init

rosdep update 错误

主要原因为20-default.list里的地址无法访问。需要在里边添加代理,总共6处,前5处在20-default.list里面,第6处位于下载文件中。

打开文件,为前5处添加代理

sudo gedit 20-default.list

在每个链接前添加代理

https://ghproxy.com/

最终如下

# os-specific listings first
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
# generic
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte

打开路径(注意不同版本的ros,python版本不同

cd /usr/lib/python3/dist-packages/rosdistro

打开文件,为第6处添加代理

sudo gedit __init__.py

编辑第68行如下

DEFAULT_INDEX_URL = 'https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'

执行

rosdep update

成后如下图所示

在这里插入图片描述

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值