ROS"/>
Ubuntu16中安装ROS
1、更换Ubuntu国内源
cd /etc/apt/
备份sources.list
打开文件sources.list
vim sources.list
将其中内容全部替换为以下内容(本次使用阿里源,之前使用清华源apt update报错过):
deb / xenial main restricted universe multiverse
deb / xenial-security main restricted universe multiverse
deb / xenial-updates main restricted universe multiverse
deb / xenial-proposed main restricted universe multiverse
deb / xenial-backports main restricted universe multiverse
deb-src / xenial main restricted universe multiverse
deb-src / xenial-security main restricted universe multiverse
deb-src / xenial-updates main restricted universe multiverse
deb-src / xenial-proposed main restricted universe multiverse
deb-src / xenial-backports main restricted universe multiverse
保存退出
apt update
下载更新成功!(上次使用清华源到这一步更新失败)
2、替换ROS国内源
sudo sh -c '. /etc/lsb-release && echo "deb / `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
设置key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
再次更新apt
apt update
3、安装ROS
sudo apt-get install ros-kinetic-desktop-full
安装成功!
设置环境变量
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
4、初始化rosdep
rosdep init
失败!
报错信息如下:
ERROR: cannot download default sources list from:
.list.d/20-default.list
Website may be down.
cd /etc
sudo mkdir ros
cd ros
sudo mkdir rosdep
cd rosdep
sudo mkdir source.list.d
cd source.list.d
sudo touch 20-default.list
vim 20-default.list
粘贴如下内容:
#os-specific listings first
yaml .yaml osx
#generic
yaml .yaml
yaml .yaml
yaml .yaml
gbpdistro .yaml fuerte
#newer distributions (Groovy, Hydro, …) must not be listed anymore, they are being
#fetched from the rosdistro index.yaml instead
保存退出
rosdep update
更新成功!
O了!
以前在Ubuntu18下面安装ROS很顺利啊,怎么在Ubuntu16下面安装就这么费劲呢,沃尼玛!
更多推荐
Ubuntu16中安装ROS
发布评论