ubuntu安装ros时运行sudo rosdep init报错

        针对这个问题在网上找了很多方法,大部分都说是网络原因,要么使用加速器上网(你懂得),要么用手机热点,还有就是非常麻烦的通过修改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

这时候应该就可以解决了,如果还是不行到这一步后切换手机热点再试一下应该就没问题了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值