一、ubuntu16.04換國內軟件源
https://blog.csdn.net/qq_40584960/article/details/104298468
二、按照官方教程來安裝(ros源也用國內的)
官方文檔教程:http://wiki.ros.org/cn/kinetic/Installation/Ubuntu#cn.2BAC8-kinetic.2BAC8-Installation.2BAC8-PostInstall.A.2BZVl6Cw-
三、可能遇到的問題:
1、linux安裝時出現——有一些軟件包無法被安裝
解決辦法:
打開更新設置,在“更新”選項卡中選則:重要安全更新 和 推薦更新
2、sudo apt-get update 報錯
報錯內容:
(http://packages.ros.org/ros/ubuntu xenial InRelease: 由於沒有公鑰,無法驗證下列簽名)
解決辦法:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
3、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.
解決辦法:
1.有可能網絡原因,多試幾次,換手機熱點也行
2.必殺技能:修改hosts
sudo gedit /etc/hosts
在最後一行加入
sudo gedit /etc/hosts
3.或者卸載ROS,再重裝
卸載方法:https://blog.csdn.net/qq_40584960/article/details/104299857
4.其他辦法:https://blog.csdn.net/u013468614/article/details/102917569
4、rosdep update報錯
報錯內容:
ERROR : error loading sources list 😦‘The read operation timed out’,)
解決辦法:
一般都是網絡問題,電腦連WiFi不行,換成手機熱點多試幾次就可以了,這個是真的有毒
不行就必殺技:
更改 /usr/lib/python2.7/dist-packages/rosdep2/下的三個文件sources_list.py、gbpdistro_support.py、rep3.py
中的DOWNLOAD_TIMEOUT = 15.0值,改大一點就可以了。
sudo vim /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
然後利用vim的搜索功能輸入:/DOWNLOAD_TIMEOUT搜索到這一行,修改過後輸入:wq保存退出就行了。