Ubuntu(Linux)上安装ROS缓慢,解决方法:添加ros的国内镜像源,以及ROS安装过程使用rosdep update出现错误:‘The read operation timed out‘

1 解决Unbuntu上安装ROS特别慢问题

在安装ROS的时候速度特别慢,显示需要时间可能需要一天多,网上查看提示可以更换下载ros的镜像源

1.1 Ubunut 更换ROS的镜像源为国内的镜像源

WIKI上有给出ROS的国内镜像源

1、中国科学技术大学 ros镜像源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

2、清华大学 ros镜像源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

3、北京外国语大学ros镜像源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.bfsu.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

4、上海交通大学 ros镜像源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.sjtug.sjtu.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

我用的是清华的镜像源,真的很快,嗖的一下

1.2 如果是Mint19.3系统,请参考如下添加ros镜像源

由于我的系统是Mint19.3,是Ubuntu改造出来的系统,对应的Ubuntu版本为Ubuntu18.04,因此对因的Ubuntu版本号为bionic,具体添加如下:

sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ bionic main" > /etc/apt/sources.list.d/ros-latest.list'

2 ROS安装过程sudo rosdep init+rosdep update出现错误:‘The read operation timed out’

参考

解决方法:

1、删除之前的源文件

sudo rm /etc/ros/rosdep/sources.list.d/20-default.list

2、更新

sudo apt-get update

3、rosdep初始化

sudo rosdep init

4、rosdep再次更新

rosdep update

具体操作返回信息如下:

(base) shl@zhihui-mint:~$ rosdep update 
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Add distro "dashing"
Add distro "eloquent"
Add distro "foxy"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Add distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
ERROR: error loading sources list:
	('The read operation timed out',)
(base) shl@zhihui-mint:~$ cat /etc/ros/rosdep/sources.list.d/20-default.list
# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
(base) shl@zhihui-mint:~$ sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
(base) shl@zhihui-mint:~$ sudo apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
获取:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]                                                  
忽略:3 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu bionic InRelease                                                       
获取:4 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]                                                   
获取:5 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]                                                   
命中:6 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease                                                           
命中:7 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu bionic Release                                                         
命中:8 http://dl.google.com/linux/chrome/deb stable InRelease                                                                
命中:9 http://archive.ubuntu.com/ubuntu bionic InRelease                                                                     
忽略:10 http://packages.linuxmint.com tricia InRelease                                                                       
获取:12 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                  
获取:13 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                
命中:14 http://archive.canonical.com/ubuntu bionic InRelease                                                             
命中:15 http://ppa.launchpad.net/hzwhuang/ss-qt5/ubuntu xenial InRelease                                                     
命中:16 http://packages.linuxmint.com tricia Release                                                                         
命中:17 http://ppa.launchpad.net/linrunner/tlp/ubuntu bionic InRelease                                                       
获取:19 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]        
已下载 672 kB,耗时 2(412 kB/s)                               
正在读取软件包列表... 完成
(base) shl@zhihui-mint:~$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run

	rosdep update

(base) shl@zhihui-mint:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Add distro "dashing"
Add distro "eloquent"
Add distro "foxy"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Add distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/shl/.ros/rosdep/sources.cache
(base) shl@zhihui-mint:~$ 

(base) shl@zhihui-mint:~$  cat /etc/ros/rosdep/sources.list.d/20-default.list
# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx

# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
(base) shl@zhihui-mint:~$ 
欢迎大家关注笔者,你的关注是我持续更博的最大动力


原创文章,转载告知,盗版必究

微信:suihailiang0816
QQ:931762054
wx公众号:仰望星空的小随
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 猿与汪的秘密 设计师:白松林 返回首页