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

相关推荐
IMPYLH10 分钟前
Linux 的 cp 命令
linux·运维·服务器
@syh.20 分钟前
【linux】多线程
linux
贝锐21 分钟前
立航货运携手贝锐向日葵,大型物流园区如何进行远程运维升级
运维·远程
RisunJan22 分钟前
Linux命令-man(查看Linux中的指令帮助)
linux·运维·服务器
REDcker25 分钟前
CentOS 与主流 Linux 发行版:版本与时间表(年表)
linux·运维·centos
bai_lan_ya28 分钟前
使用linux的io文件操作综合实验_处理表格
linux·服务器·算法
扁舟·TF32 分钟前
VirtuaBox: 修改 Host-Only 网络的 IP 地址
服务器·网络·tcp/ip
wd52052143 分钟前
常用环境部署(二十九)——Centos升级OpenSSH 10.2p1
linux·运维·centos·ssh
顶点多余1 小时前
Ext文件系统详解
linux·运维·服务器
圥忈&&丅佽&&扗虖1 小时前
linux 安装 Ollama
linux·服务器