Skip to content

Raspberry Pi ROS 2 Humble: Install on Ubuntu 22.04 | ShillehTek

March 27, 2025

Video Tutorial (Optional)

Watch first if you want to follow the full ROS 2 Humble install on Raspberry Pi in real time.

Project Overview

In this guide, you install ROS 2 Humble on a Raspberry Pi running Ubuntu 22.04.5 LTS (Jammy) 64-bit so you can run ROS 2 nodes using a clean binary install (no compiling from source and no Docker required).

As of ROS 2 Humble, Ubuntu 22.04 receives Tier 1 support, which makes installation straightforward on arm64.

  • Time: 15 to 30 minutes (depends on download speed)
  • Skill level: Beginner
  • What you will build: A working ROS 2 Humble environment on Raspberry Pi with a verified talker/listener test
Raspberry Pi Imager showing the menu path for selecting Ubuntu under Other general-purpose OS
Raspberry Pi Imager highlighting Ubuntu options for Raspberry Pi installation
Raspberry Pi Imager selecting Ubuntu 22.04 LTS 64-bit for Raspberry Pi before flashing

Parts List

From ShillehTek

  • ShillehTek - robotics and IoT tutorials, parts, and support

External

  • Raspberry Pi (4GB or 8GB RAM recommended)
  • Ubuntu 22.04.5 LTS (Jammy) 64-bit installed
  • Internet access
  • Raspberry Pi Imager - to flash Ubuntu to the microSD
  • curl (installed via apt if needed)

Note: This install assumes arm64 on Ubuntu Jammy. In the Imager, you may see Ubuntu 22.04.3 LTS (64-bit), which upgrades to 22.04.5 via updates.

Step-by-Step Guide

Step 1 - Confirm Ubuntu is installed and update package lists

Goal: Make sure your Raspberry Pi is on Ubuntu 22.04.x and your apt package lists are current.

What to do: If you still need to flash Ubuntu, use Raspberry Pi Imager to install Ubuntu 22.04 LTS (64-bit), then boot your Pi and connect it to the internet.

Update your package list:

sudo apt update

Expected result: apt refreshes package metadata without upgrading the OS.

Step 2 - Install curl (if it is not installed)

Goal: Ensure you can download the ROS 2 repository key in the next step.

What to do:

sudo apt install curl

Expected result: curl is available on the command line.

Step 3 - Add the ROS 2 GPG key

Goal: Trust ROS 2 packages from the official ROS repository.

What to do:

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

Expected result: The keyring file is created at /usr/share/keyrings/ros-archive-keyring.gpg.

Step 4 - Add the ROS 2 apt repository

Goal: Add the ROS 2 package source for Ubuntu Jammy on arm64.

What to do:

echo "deb [arch=arm64 signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu jammy main" | \
sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

Expected result: A new source list file is created at /etc/apt/sources.list.d/ros2.list.

Step 5 - Update apt again (now including ROS 2 packages)

Goal: Pull package metadata from the newly added ROS 2 repository.

What to do:

sudo apt update

Expected result: apt completes successfully and includes ROS 2 package listings.

Step 6 - Install ROS 2 Humble

Goal: Install ROS 2 Humble packages on your Raspberry Pi.

What to do: Install the full desktop version (includes Rviz, demos, and tools):

sudo apt install ros-humble-desktop

Or, for a minimal install:

sudo apt install ros-humble-ros-base

Expected result: ROS 2 Humble is installed and available under /opt/ros/humble.

Step 7 - Source ROS 2 in every terminal

Goal: Make ROS 2 commands (like ros2) available in your shell.

What to do: For the current terminal session:

source /opt/ros/humble/setup.bash

To make this automatic every time:

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

Expected result: Running ros2 commands works in new terminals without manually sourcing.

Step 8 - Test the installation with demo nodes

Goal: Verify ROS 2 is functioning by sending and receiving messages.

What to do: In one terminal, run:

ros2 run demo_nodes_cpp talker

In another terminal, run:

ros2 run demo_nodes_cpp listener

Expected result: The listener receives messages from the talker.

Step 9 - Optional: Install build and workspace tools

Goal: Set up common development tools for building ROS 2 workspaces and managing dependencies.

What to do: Install colcon extensions:

sudo apt install python3-colcon-common-extensions

For dependency management with rosdep:

sudo apt install python3-rosdep
sudo rosdep init
rosdep update

Expected result: colcon and rosdep are installed and ready for workspace use.

Conclusion

You installed ROS 2 Humble on a Raspberry Pi running Ubuntu 22.04.5 LTS, added the official ROS 2 repository, and verified the setup using the demo talker and listener nodes.

Want support for your first workspace, GPIO integration, or motor control with ROS 2? Grab parts and project essentials from ShillehTek.com. For help customizing your robotics or IoT setup, check out our IoT consulting services.

Author: Mahmood Shilleh
Need help with Raspberry Pi, IoT, or Robotics? Find me on YouTube or Upwork.