ROS初始化 sudo rosdep init失败

(1) 安装完ROS后,初始化指令sudo rosdep init失败,提示: sudo: rosdep:command not found
按照以下方式解决:

sudo apt install rospack-tools

之后运行 sudo rosdep init 即可
ROS初始化 sudo rosdep init失败_第1张图片
(2)安装完ROS后,初始sudo rosdep init,显示:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
如下图:

ROS初始化 sudo rosdep init失败_第2张图片
解决办法:
首先 /etc 目录下打开终端,输入以下命令以更改hosts文件权限

cd /etc
sudo chmod a+rw hosts

接着打开hosts文件,在文件末尾添加以下内容,并保存后退出

151.101.84.133  raw.githubusercontent.com

ROS初始化 sudo rosdep init失败_第3张图片

你可能感兴趣的:(Ubuntu/ROS)