配置系统软件源
添加ROS软件源
官方源下载速度很慢,为了提高下载速度,使用中科大源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
添加ROS密钥
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
安装ROS
首先使用如下命令,确保软件源修改得以更新:
sudo apt-get update
有报错如下图
错误一:
E: Failed to fetch http://ppa.launchpad.net/fcitx-team/nightly/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
解决方法:
sudo mv fcitx-team-ubuntu-nightly-xenial.list fcitx-team-ubuntu-nightly-xenial.list.bak
错误二:
W: GPG error: http://mirrors.ustc.edu.cn/ros/ubuntu xenial InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
W: The repository ‘http://mirrors.ustc.edu.cn/ros/ubuntu xenial InRelease’ is not signed.
N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
解决方法:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
安装桌面完整版
sudo apt-get install ros-kinetic-desktop-full
初始化rosdep
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.
解决方法:
有可能是没有安装证书库所致,可以尝试如下命令:
sudo apt-get install ca-certificates
重新初始化
sudo rosdep init
rosdep update
设置环境变量
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc