服务器安装 ros2时遇到底层库依赖冲突的问题

近期工作需要用到ros2, 所以在一台服务器上准备安装ros2, 先按照官网走安装流程

参考: Ubuntu (deb packages) --- ROS 2 Documentation: Humble documentation

设置utf-8

bash 复制代码
locale  # check for UTF-8

sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

locale  # verify settings

添加ros2 apt软件源并下载ros2-apt-source、解压缩

bash 复制代码
sudo apt install software-properties-common
sudo add-apt-repository universe
bash 复制代码
sudo apt update && sudo apt install curl -y
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" # If using Ubuntu derivates use $UBUNTU_CODENAME
sudo dpkg -i /tmp/ros2-apt-source.deb

更新软件源:

bash 复制代码
sudo apt update
sudo apt upgrade

安装ros:

bash 复制代码
sudo apt install ros-humble-desktop

遇到报错:

在更新软件源后修复:

  1. 备份当前源
bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  1. 修改/etc/apt/sources.list 文件为:
bash 复制代码
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
  1. 更新并重新安装:
bash 复制代码
sudo apt update
bash 复制代码
sudo apt install ros-humble-desktop

即可完成ros2在linux下的环境配置, 测试:

相关推荐
wdfk_prog20 分钟前
[Linux]学习笔记系列 -- lib/sort.c 通用的排序库(Generic Sorting Library) 为内核提供标准的、高效的排序功能
linux·运维·c语言·笔记·stm32·学习·bug
jump_jump25 分钟前
前端部署工具 PinMe
运维·前端·开源
闲人编程38 分钟前
深入理解Python的`if __name__ == ‘__main__‘`:它到底做了什么?
服务器·数据库·python·main·name·魔法语句
黑马金牌编程38 分钟前
简易分析慢 SQL 的流程和方法
linux·数据库·mysql·性能优化·性能分析·慢日志
什么半岛铁盒1 小时前
C++项目:仿muduo库高并发服务器---------LoopThreadPool模块和TcpServer模块的实现
linux·服务器·c++·mysql·ubuntu
それども1 小时前
本地怎么远程调试服务器
运维·服务器
Lin_Aries_04212 小时前
容器化 Flask 应用程序
linux·后端·python·docker·容器·flask
鹏大师运维3 小时前
麒麟系统中修改 WPS 默认新建文件格式的方法
linux·操作系统·wps·docx·麒麟·word文档·excel文档
斯普信专业组4 小时前
Filebeat写ElasticSearch故障排查思路(上)
运维·elasticsearch·中间件·filebeat
Lin_Aries_04214 小时前
通过配置 GitLab 自动触发项目自动化构建与部署
运维·docker·容器·自动化·云计算·gitlab