服务器安装 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下的环境配置, 测试:

相关推荐
牛奶咖啡1320 小时前
Linux常见系统故障案例说明并修复解决(下)
linux·服务器·文件系统挂载异常分析并修复·持久化挂载分区文件丢失故障修复·分析系统进程cpu占用率过高
java_logo20 小时前
Webtop Docker 容器化部署指南:基于浏览器的Linux桌面环境
linux·docker·容器·webtop·webtop部署教程·docker部署webtop·linux桌面
Bruce_Liuxiaowei20 小时前
SSH主机密钥验证失败(Host key verification failed)深度解析与解决方案
运维·网络·ssh
^_scv_^20 小时前
QEMU-RISCV平台opensbi代码分析(2)
linux·架构·risc-v
core51220 小时前
Nginx 实战:如何通过代理转发下载中文文件并保留原文件名
运维·nginx·代理·下载·转发
OliverH-yishuihan21 小时前
在 Windows 上安装 Linux
linux·运维·windows
zclinux_21 小时前
【Linux】虚拟化的内存气泡
linux·运维·服务器
爱潜水的小L21 小时前
自学嵌入式day33,互斥和同步
linux
tianyuanwo21 小时前
深度解析 - 软件包依赖安装机制与故障排除
服务器·yum·dnf·安装依赖
松涛和鸣21 小时前
DAY33 Linux Thread Synchronization and Mutual Exclusion
linux·运维·服务器·前端·数据结构·哈希算法