解决sudo rosdep init 报错的问题

  • 时间:
  • 来源:互联网
  • 文章标签:

按照https://wiki.ros.org/cn/melodic/Installation/Ubuntu 中步骤安装,进行到sudo rosdep init 提示找不到命令

在网上找了下解决办法,如:

sudo apt install python-rosdep
执行之后,又提示
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.

接着按照https://www.jianshu.com/p/bdbfbac69114 这上的面操作步骤 来 

sudo apt-get install ca-certificates

新建目录 /etc/ros/rosdep/sources.list.d

新建文件 sudo gedit 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 还是报错

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](http://jump.bdimg.com/safecheck/index?url=rN3wPs8te/pX/RXZrrwmgz1HhLKFfuYdBR6elVnGSRMPTZwDs+V1Iw2DN2GIDg0c0lXFaWYCi6F5eugIuTik7Xf24HznH1heOw2gAEfI/e4pyVgDjNm3SaoaxT39lV2h1C6ZRqu3Ohsi0ZhQy1cgW5DaxsU0VVq099hJLALtyPraHkhVQYEleySdzQDlWLfuyu4YXs62n7WWp87t6F1nMhvv0JflI+P2dj2oeHoEzTI=)]:
<urlopen error _ssl.c:495: The handshake operation timed out> ([https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml](http://jump.bdimg.com/safecheck/index?url=rN3wPs8te/pX/RXZrrwmgz1HhLKFfuYdBR6elVnGSRMPTZwDs+V1Iw2DN2GIDg0c0lXFaWYCi6F5eugIuTik7Xf24HznH1heOw2gAEfI/e4pyVgDjNm3SaoaxT39lV2h1C6ZRqu3Ohsi0ZhQy1cgW5DaxsU0VVq099hJLALtyPraHkhVQYEleySdzQDlWLfuyu4YXs62n7WWp87t6F1nMhvv0JflI+P2dj2oeHoEzTI=))
Hit [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml](http://jump.bdimg.com/safecheck/index?url=rN3wPs8te/pX/RXZrrwmgz1HhLKFfuYdBR6elVnGSRMPTZwDs+V1Iw2DN2GIDg0c0lXFaWYCi6F5eugIuTik7Xf24HznH1heOw2gAEfI/e64EpZhV/nSSfaMCRlMqNMjqsw5JFtciolkdT5HNLb22Z8xZQwNWZn8DhrNz7QOmul3vNSiiiuylvEgZ+MKQ61lxfjiJ1xO6k1T0sjgIIm+zjA8Zu4mdgY0)
ERROR: error loading sources list:
The read operation timed out

他的解决办法 

sudo apt-get update
sudo apt-get install python-rosdep

不能解决我的问题。

 

接着在网络中找到这篇文章

http://community.bwbot.org/topic/878/%E8%A7%A3%E5%86%B3rosdep-init-error-cannot-download-default-sources-list-%E9%97%AE%E9%A2%98

说是 如果你在执行 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.

这是由于raw.githubusercontent.com被墙,程序无法下载相应的文件导致的。

就按照他的方法,修改hosts文件。

把下面的内容写入/etc/hosts文件中。

192.30.253.118 gist.github.com
185.199.110.153 github.io

151.101.113.194 github.global.ssl.fastly.net
52.216.227.168 github-cloud.s3.amazonaws.com
52.74.223.119 github.com

199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 user-images.githubusercontent.com
199.232.28.133 avatars.githubusercontent.com
199.232.28.133 github.map.fastly.net
199.232.28.133 avatars7.githubusercontent.com

# Amazon AWS Start
54.239.31.69	aws.amazon.com
54.239.30.25	console.aws.amazon.com
54.239.96.90	ap-northeast-1.console.aws.amazon.com
54.240.226.81	ap-southeast-1.console.aws.amazon.com
54.240.193.125	ap-southeast-2.console.aws.amazon.com
54.239.54.102	eu-central-1.console.aws.amazon.com
177.72.244.194	sa-east-1.console.aws.amazon.com
176.32.114.59	eu-west-1.console.aws.amazon.com
54.239.31.128	us-west-1.console.aws.amazon.com
54.240.254.230	us-west-2.console.aws.amazon.com
54.239.38.102	s3-console-us-standard.console.aws.amazon.com
54.231.49.3	s3.amazonaws.com
52.219.0.4	s3-ap-northeast-1.amazonaws.com
54.231.242.170	s3-ap-southeast-1.amazonaws.com
54.231.251.21	s3-ap-southeast-2.amazonaws.com
54.231.193.37	s3-eu-central-1.amazonaws.com
52.218.16.140	s3-eu-west-1.amazonaws.com
52.92.72.2	s3-sa-east-1.amazonaws.com
54.231.236.6	s3-us-west-1.amazonaws.com
54.231.168.160	s3-us-west-2.amazonaws.com
52.216.80.48	github-cloud.s3.amazonaws.com
54.231.40.3	github-com.s3.amazonaws.com
52.216.20.171	github-production-release-asset-2e65be.s3.amazonaws.com
52.216.228.168	github-production-user-asset-6210df.s3.amazonaws.com

再执行rosdep update 就OK了。

 

至于中间的操作 自己新建20-default.list文件 是否有必要,不清楚。一路试探下来的,没有再返回单独测试。 记录这个操作,只为防止以后重新安装时再遇到这个问题。能解决问题就行,不求严谨。

 

 

 

 

 

 

 

 

 

 

 

 

 

本文链接http://www.taodudu.cc/news/show-83033.html