在Ubuntu16.04操作系统上安装ROS Kinetic

1、添加ROS软件源

可添加ROS官方的软件源镜像
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

也可用以下任意一种国内的镜像源

中国科学技术大学(USTC)镜像源(亲测可用)
$ sudo sh -c 'echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

中山大学(Sun Yat-Sen Univercity)镜像源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirror.sysu.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

易科机器人实验室镜像源
sudo sh -c '. /etc/lsb-release && echo "deb http://ros.exbot.net/rospackage/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

 

2、添加秘钥

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

如果在连接密钥服务器时遇到了问题,可以尝试在上面的命令中用 hkp://keyserver.ubuntu.com:80 来替换。

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

3、安装ROS

$ sudo apt-get update    (先确保之前修改的软件源得以更新)

$sudo apt-get install ros-kinetic-desktop-full

 

如果报下面的错

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: ros-kinetic-desktop-full : Depends: ros-kinetic-desktop but it is not going to be installed Depends: ros-kinetic-perception but it is not going to be installed Depends: ros-kinetic-simulators but it is not going to be installed Depends: ros-kinetic-urdf-tutorial but it is not going to be installed E: Unable to correct problems, you have held broken packages.

解决:(参考文章https://blog.csdn.net/xiangxianghehe/article/details/78483799)

1.删除ros-latest.list

rm -rf /etc/apt/sources.list.d/ros-latest.list
  • 1

2.修改源:

vi /etc/apt/sources.list

然后改为以下内容:

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

接下来从第一步——设置安装源那里开始,从头安装即可。

 

如果报下面的错:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.ros.org/ros/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654
W: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/xenial/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F42ED6FBAB17C654

解决方法:

$ apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F42ED6FBAB17C654

 

 

 

 

 

 

你可能感兴趣的:(在Ubuntu16.04操作系统上安装ROS Kinetic)