一般原因是因为 raw.githubusercontent.com 被墙掉了,无法更新。
这边通过hosts指定ip地址的方式来解决问题。
首先在terminal中测试ip是否连得通
ping 151.101.84.133
如果连不通,http://ping.chinaz.com/raw.githubusercontent.com可通过网站查找能用的ip。
得到可以用的IP之后,将其加到hosts文件内。
terminal中输入以下命令,打开hosts文件
sudo gedit /etc/hosts
在最后一行加上
151.101.84.133 raw.githubusercontent.com
右上角保存,然后关闭编辑器
再terminal中
sudo rosdep init
rosdep update
也没问题
不行就多打几次init命令,偶尔也会失败。