解决Ubuntu18.04 安装ROS中 sudo rosdep init 和 rosdep update 失败问题
目录
解决Ubuntu18.04 安装ROS中 sudo rosdep init 和 rosdep update 失败问题
三、运行rosdep update连接超时(Errno 104)
一、sudo rosdep init 找不到命令提示
sudo apt-get install python-rosdep
二、运行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.
主要原因是被樯了,我测试了网上多种方法 ,如修改DNS、修改IP、设置hosts文件等,都不行,所以一气之下我就直接翻墙出去查看这个文件内容,拷贝手动存储。结果可行(时间:2021年5月27日)
具体方法如下:
sudo mkdir -p /etc/ros/rosdep/sources.list.d/
sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list
把如下内容拷贝进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
然后直接运行rosdep update即可;如果再运行 sudo rosdep init 可能依然会提示无法下载或者提示以存在。
三、运行rosdep update连接超时(Errno 104)
reading in sources list data from /etc/ros/rosdep/sources.list.d
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
<urlopen error timed out> (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]:
<urlopen error timed out> (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]:
<urlopen error timed out> (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]:
<urlopen error [Errno 104] Connection reset by peer> (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:
<urlopen error ('_ssl.c:711: The handshake operation timed out',)>
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
ERROR: error loading sources list:
<urlopen error <urlopen error timed out> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>
上面 为本色更改DNS 等后的错误 ,在本人运行时以改回 ,主要看代码 104 的问题即可
本人最终是通过这里解决的,即利用https://ghproxy.com/进行代理加速,本文不再进行介绍,下面只对自己遇到的问题进行接受;
经过上篇文章进行修改后出现了:
reading in sources list data from /etc/ros/rosdep/sources.list.d
Warning: running 'rosdep update' as root is not recommended.
You should run 'sudo rosdep fix-permissions' and invoke 'rosdep update' again without sudo.
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
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]:
Failed to download target platform data for gbpdistro:
<urlopen error [Errno 104] Connection reset by peer>
Query rosdistro index https://ghproxy.com/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"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/user/.ros/rosdep/sources.cache
ERROR: Not all sources were able to be updated.
[[[
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]:
Failed to download target platform data for gbpdistro:
<urlopen error [Errno 104] Connection reset by peer>
]]]
经过评论区大佬的提示:需要在/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py中插入 gbpdistro_url = "https://ghproxy.com/" + gbpdistro_url ,如下:
gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
如图插入:
再运行rosdep update 即可: