2  Installation

Important

You are reading the work-in-progress edition of ROS 2 : Mea Via et Mea Disciplina. This chapter is currently a dumping ground for ideas, and we don’t recommend reading it. The complete version will be available here soon. Stay tuned!

We recommend and use ROS2: humble (for now).

2.1 Set Locale


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

2.2 Setup Sources

sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

2.3 Install ROS2 packages

sudo apt update
sudo apt upgrade

here you have three options,

sudo apt install ros-humble-desktop

or

sudo apt install ros-humble-ros-base

or

sudo apt install ros-humble-ros-dev-tools

2.4 Environment setup

# Replace ".bash" with your shell if you're not using bash
# Possible values are: setup.bash, setup.sh, setup.zsh
source /opt/ros/humble/setup.bash

2.5 Uninstall

sudo apt remove ~nros-humble-* && sudo apt autoremove
sudo rm /etc/apt/sources.list.d/ros2.list
sudo apt update
sudo apt autoremove
# Consider upgrading for packages previously shadowed.
sudo apt upgrade

2.6 Set Locale

locale  # check for UTF-8

sudo dnf install langpacks-en glibc-langpack-en
export LANG=en_US.UTF-8

locale  # verify settings

2.7 Setup Sources

sudo dnf install 'dnf-command(config-manager)' epel-release -y
sudo dnf config-manager --set-enabled powertools
Note

This step may be slightly different depending on the distribution you are using. Check the EPEL documentation:https://docs.fedoraproject.org/en-US/epel/#_quickstart

sudo dnf install curl
sudo curl --output /etc/yum.repos.d/ros2.repo http://packages.ros.org/ros2/rhel/ros2.repo
sudo dnf makecache

2.8 Install ROS2 packages

sudo dnf update
sudo dnf install ros-humble-desktop

or simply

sudo dnf install ros-humble-ros-base

2.9 Environment setup

# Replace ".bash" with your shell if you're not using bash
# Possible values are: setup.bash, setup.sh, setup.zsh
source /opt/ros/humble/setup.bash

2.10 Uninstall

sudo dnf remove ros-humble-*
Danger

Sorry, we dont do that here, although it is quite possible with ros2