ROS安装填坑

       最近因为比赛项目要给实验室的TX2安装ROS系统。本来以为顶多就是因为网络环境差安装慢一点,事实证明自己还是To Young了。下面简述一下自己遇到的坑。。。。。。

1.软件源

       实验室的TX2在去年(2019)暑假开始装好系统后就再也没重装过系统,中间装过GPU版本的Tensorflow,CUDA等一系列软件,软件源被换过无数次。随便执行一个“sudo apt-get update”就会有多个 “在XXX和XXX中被配置了多次” 类似的错误出现。联想到当时学姐在安装TensorFlow-GPU和CUDA时的痛苦场面我果断决定为了自己的身心健康还是在现有系统的基础上解决错误吧。于是自己一怒之下把 “etc/apt/sources.list” 里边的内容都删掉了~

       首先求稳在网上找到TX2 Ubuntu16.04的官方源,执行“sudo gedit /etc/apt/sources.list”命令打开gedit直接复制粘贴保存,之后用“sudo apt-get update”命令更新。不得不说,官方源就是稳,中间除了网速比较慢等的时间比较长一点基本没出错误。下面给出官方源:

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
# deb http://ports.ubuntu.com/ubuntu-ports/ xenial universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial universe
# deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted

deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted
# deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe
# deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse

       当然我也试了一下国内的中科大源,不仅稳而且快!可以作为网络环境较差使用官方源下载较慢的情况下的备选方案。下面给出中科大源:

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

       最后给出自己的人生建议:在更换源的时候尽量做一下备份,不然换源成功后出问题不能update的还不能再换回原来的源这种情况会让你稍微有些尴尬......

2.rosdep update出错

       这才是今天的重头戏,这次rosdep update出的错误真的是史无前例!之前都是因为网速慢而timeout,这次的错误我甚至在国内的各种论坛博客上都没找到,最后还是同学在外网找到的解决办法。先把错误贴出来:

ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
	 (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]:
	 (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml]:
	 (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]:
	 (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]:
	Failed to download target platform data for gbpdistro:
	
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
ERROR: error loading sources list:
	 (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>

       我找了一下“SSL: CERTIFICATE_VERIFY_FAILED”的信息。产生这个错误的原因在于python本身,python升级到2.7.9引入了一个新特性,当使用urllib打开https的链接时,会检验一次ssl证书。而当目标网站使用的是自签名证书时,就会抛出urllib2.URLError的错误。

       在深入查阅资料后我发现,https使用非对称加密,客户端(在这里是TX2)必须要手握公钥才能和服务器加密通信。ubuntu系统的公钥存放在/etc/ssl/certs/ca-certificates.crt中,这个文件中存储了大部分公钥,在使用“rosdep update”命令之前可以使用“

export SSL_CERT_FILE=/usr/lib/ssl/certs/ca-certificates.crt

”命令指定环境变量。之后即可成功执行rosdep update命令。

对SSL详细了解

 

你可能感兴趣的:(英特尔杯学习记录,Ubuntu,ubuntu,ssl)