解决rosdep init报错“Website may be down”

司空皓
2023-12-01

解决rosdep init报错“Website may be down”

reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit 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/sources.list.d/20-default.list - gary_123 - 博客园

https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list_Ericztoa的博客-CSDN博客

sudo rosdep init报错的解决方式_PuerAloe的博客-CSDN博客_sudorosdepinit报错

解决rosdep init报错“Website may be down” - 知乎

以及查找路由,Hosts里面设置。更换网络等等,就差买个vpn了。都不行。

总结: 不是方法有误,而是写的不详细:

方案如下:

1. 下载 git clone https://github.com/ros/rosdistro.git 到home路径里

2. 设置,找不到找找python2.7,这个跟python主要版本有关,灵活点

xx@xx:/usr/lib/python3/dist-packages/rosdep2$ sudo gedit rep3.py
xx@xx:/usr/lib/python3/dist-packages/rosdep2$ sudo gedit sources_list.py

xx@xx:/usr/lib/python3/dist-packages/rosdep2$ sudo gedit gbpdistro_support.py

https://raw.githubusercontent.com/ros/rosdistro/master
替换为
file:///home/bozhon/rosdistro

可以检查一下,把能社会的都设置了

3. 设置(很重要,不然老有一个东西找index-v4.yaml或者其他文件)

xx@xx:/usr/lib/python3/dist-packages/rosdistro$ sudo gedit __init__.py

https://raw.githubusercontent.com/ros/rosdistro/master
替换为
file:///home/bozhon/rosdistro

4.  如果有,则删除

xx@xx:/etc/ros/rosdep/sources.list.d$ sudo rm -rf 20-default.list

5.  sudo rosdep init

6.  进入下载的rosdistro/rosdep/sources.list.d更改  gedit 20-default.list

# os-specific listings first
yaml file:///home/xx/rosdistro/rosdep/osx-homebrew.yaml osx

# generic
yaml file:///home/xx/rosdistro/rosdep/base.yaml
yaml file:///home/xx/rosdistro/rosdep/python.yaml
yaml file:///home/xx/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/xx/rosdistro/releases/fuerte.yaml fuerte

# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

 7.   成功

reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit file:///home/xx/rosdistro/rosdep/osx-homebrew.yaml
Hit file:///home/xx/rosdistro/rosdep/base.yaml
Hit file:///home/xx/rosdistro/rosdep/python.yaml
Hit file:///home/xx/rosdistro/rosdep/ruby.yaml
Hit file:///home/xx/rosdistro/releases/fuerte.yaml
Query rosdistro index file:///home/xx/rosdistro/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"
Add distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/xx/.ros/rosdep/sources.cache

说明:1.    /home/xx: 是home路径,rosdistro我直接下载到home路径下。  注意路径

          2. 过程中,老有些地方指示到: https://raw.githubusercontent.com,说明没有改。

         3. 我换了两个手机热点,都不行,但是也学习到了比如使用工具查找ip

    还是感谢网络上分享的同学

我的电脑是Ubuntu20.04,使用的python3,如果没有Python3的话可能是低版本Ubuntu,请找python2.7

欢迎交流

email: tongzhuodenilove@163.com

        

 类似资料: