Linux Installation

These instructions tell you how to set up your own Linux environment for the course.

Install Ubuntu 22.04

Update System

Very important! Make sure that your system is updated before doing the next steps. You do this by opening a terminal and run the commands:

sudo apt update
sudo apt upgrade

Install ROS 2 Humble

We will be using the ROS 2 Humble version for this course. It is the latest long-term supported (LTS) version of ROS2. Here we will only go over the commands you need to run in order to install it. If you want more detailed instructions you can follow the official installation guide on the ROS Humble page (https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html Links to an external site.).

Set Locale

First check what locale settings you have using the following command

locale

Make sure you have a locale which supports UTF-8. You should see a many lines containing UTF-8 as a result of the above command. It should be fine with any UTF-8 supported locale, but below we us en_US.UTF-8.

If you need to update your locale follow the commands below, otherwise move on to the next section.

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

Verify the settings again

locale

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

Install ROS 2 packages

sudo apt update
sudo apt upgrade
sudo apt install ros-humble-desktop-full git

Environment setup

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc

SSD setup

To ensure a predictable behaviour of the Linux machine when only booted occationally and assuming that you do not keep sensitive information on it we have disable automatic updates using the following command.

sudo dpkg-reconfigure unattended-upgrades

Please make sure to keep your machine up to date by running the folllowing regularly but when it fits you to have the machine busy. Remember that a machine that someone can break into is a problem for the whole network and not only you.

sudo apt update
sudo apt upgrade