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

相关推荐
KKKlucifer4 小时前
自动化漏洞利用技术颠覆传统:微软生态暴露的攻防新变局
运维·microsoft·自动化
此心光明事上练4 小时前
大厂级企业后端:配置变更与缓存失效的自动化处理方案
运维·缓存·自动化
java_logo4 小时前
Docker 部署 MinIO 全指南
运维·windows·mongodb·docker·容器
tongsound5 小时前
libmodbus 使用示例
linux·c++
拾光Ծ5 小时前
【Linux】“ 权限 “ 与相关指令
linux·运维·服务器
歪歪1005 小时前
React Native开发有哪些优势和劣势?
服务器·前端·javascript·react native·react.js·前端框架
硬核子牙5 小时前
调试器是怎么让代码停下来的
linux
To_再飞行5 小时前
Linux Bash(一)
linux·运维·服务器·bash
我狸才不是赔钱货5 小时前
DevOps:打破开发与运维之间的高墙
运维·vscode·docker·devops
LCG元5 小时前
保姆级教程:CentOS 7/8 部署Nginx + MySQL + PHP(LEMP)环境,从零开始到上线项目
linux