sudo rosdep init update 出错的最新解决方案

2024-03-19 06:38

本文主要是介绍sudo rosdep init update 出错的最新解决方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

问题分析

安装ros 执行sudo rosdep init 或者rosdep update出错的主要原因:https://raw.githubusercontent.com网站国内访问受限

最新解决方案

原理

既然网站服务器访问受限,不如把服务器中的文件拷贝下来,在本地进行 init和update.

第一步 下载服务器中的文件

打开终端,输入下面指令:

git clone https://github.com/ros/rosdistro.git

最终会得到所用的文件,文件路径为(注意user替换为自己的用户名):

/home/user/rosdistro

第二步 修改文件

  1. 20-default.list文件,将服务器地址更换为本地。
sudo gedit /home/user/rosdistro/rosdep/sources.list.d/20-default.list 
# os-specific listings first
yaml file:///home/yourname/rosdistro/rosdep/osx-homebrew.yaml osx# generic
yaml file:///home/user/rosdistro/rosdep/base.yaml
yaml file:///home/user/rosdistro/rosdep/python.yaml
yaml file:///home/user/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/user/rosdistro/releases/fuerte.yaml fuerte# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
  1. gbpdistro_support.py 文件,同理。
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
FUERTE_GBPDISTRO_URL = 'file:///home/user/rosdistro/releases/fuerte.yaml'
  1. rep3.py文件
sudo gedit /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
REP3_TARGETS_URL = 'file:///home/user/rosdistro/releases/targets.yaml'
  1. _init_.py文件
sudo gedit /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
DEFAULT_INDEX_URL = 'file:///home/user/rosdistro/index-v4.yaml'

第三步 创建20-default.list文件,模拟 执行rosdep init的过程

sudo mkdir -p /etc/ros/rosdep/sources.list.d
cd /etc/ros/rosdep/sources.list.d
sudo touch 20-default.list
sudo gedit 20-default.list

复制以下内容,保存退出。

#os-specific listings first
yaml file:///home/user/rosdistro/rosdep/osx-homebrew.yaml osx
#generic
yaml file:///home/user/rosdistro/rosdep/base.yaml
yaml file:///home/user/rosdistro/rosdep/python.yaml
yaml file:///home/user/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/user/rosdistro/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命令

rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit file:///home/user/rosdistro/rosdep/osx-homebrew.yaml
Hit file:///home/user/rosdistro/rosdep/base.yaml
Hit file:///home/user/rosdistro/rosdep/python.yaml
Hit file:///home/user/rosdistro/rosdep/ruby.yaml
Hit file:///home/user/rosdistro/releases/fuerte.yaml
Query rosdistro index file:///home/user/rosdistro/index-v4.yaml
Skip end-of-life distro "ardent"
Add distro "bouncy"
Add distro "crystal"
Add distro "dashing"
Add distro "eloquent"
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"
updated cache in /home/user/.ros/rosdep/sources.cache

至此问题解决。

这篇关于sudo rosdep init update 出错的最新解决方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/825109

相关文章

SpringBoot3匹配Mybatis3的错误与解决方案

《SpringBoot3匹配Mybatis3的错误与解决方案》文章指出SpringBoot3与MyBatis3兼容性问题,因未更新MyBatis-Plus依赖至SpringBoot3专用坐标,导致类冲... 目录SpringBoot3匹配MyBATis3的错误与解决mybatis在SpringBoot3如果

C++ vector越界问题的完整解决方案

《C++vector越界问题的完整解决方案》在C++开发中,std::vector作为最常用的动态数组容器,其便捷性与性能优势使其成为处理可变长度数据的首选,然而,数组越界访问始终是威胁程序稳定性的... 目录引言一、vector越界的底层原理与危害1.1 越界访问的本质原因1.2 越界访问的实际危害二、基

Python 字符串裁切与提取全面且实用的解决方案

《Python字符串裁切与提取全面且实用的解决方案》本文梳理了Python字符串处理方法,涵盖基础切片、split/partition分割、正则匹配及结构化数据解析(如BeautifulSoup、j... 目录python 字符串裁切与提取的完整指南 基础切片方法1. 使用切片操作符[start:end]2

python中update()函数的用法和一些例子

《python中update()函数的用法和一些例子》update()方法是字典对象的方法,用于将一个字典中的键值对更新到另一个字典中,:本文主要介绍python中update()函数的用法和一些... 目录前言用法注意事项示例示例 1: 使用另一个字典来更新示例 2: 使用可迭代对象来更新示例 3: 使用

MyBatis的xml中字符串类型判空与非字符串类型判空处理方式(最新整理)

《MyBatis的xml中字符串类型判空与非字符串类型判空处理方式(最新整理)》本文给大家介绍MyBatis的xml中字符串类型判空与非字符串类型判空处理方式,本文给大家介绍的非常详细,对大家的学习或... 目录完整 Hutool 写法版本对比优化为什么status变成Long?为什么 price 没事?怎

Linux部署中的文件大小写问题的解决方案

《Linux部署中的文件大小写问题的解决方案》在本地开发环境(Windows/macOS)一切正常,但部署到Linux服务器后出现模块加载错误,核心原因是Linux文件系统严格区分大小写,所以本文给大... 目录问题背景解决方案配置要求问题背景在本地开发环境(Windows/MACOS)一切正常,但部署到

Java中InputStream重复使用问题的几种解决方案

《Java中InputStream重复使用问题的几种解决方案》在Java开发中,InputStream是用于读取字节流的类,在许多场景下,我们可能需要重复读取InputStream中的数据,这篇文章主... 目录前言1. 使用mark()和reset()方法(适用于支持标记的流)2. 将流内容缓存到字节数组

MybatisPlus中removeById删除数据库未变解决方案

《MybatisPlus中removeById删除数据库未变解决方案》MyBatisPlus中,removeById需实体类标注@TableId注解以识别数据库主键,若字段名不一致,应通过value属... 目录MyBATisPlus中removeBypythonId删除数据库未变removeById(Se

创建springBoot模块没有目录结构的解决方案

《创建springBoot模块没有目录结构的解决方案》2023版IntelliJIDEA创建模块时可能出现目录结构识别错误,导致文件显示异常,解决方法为选择模块后点击确认,重新校准项目结构设置,确保源... 目录创建spChina编程ringBoot模块没有目录结构解决方案总结创建springBoot模块没有目录

idea Maven Springboot多模块项目打包时90%的问题及解决方案

《ideaMavenSpringboot多模块项目打包时90%的问题及解决方案》:本文主要介绍ideaMavenSpringboot多模块项目打包时90%的问题及解决方案,具有很好的参考价值,... 目录1. 前言2. 问题3. 解决办法4. jar 包冲突总结1. 前言之所以写这篇文章是因为在使用Mav