How to Install ROS 2 Lyrical

In this tutorial, we will install ROS 2 Lyrical Luth.

By the end of this tutorial, you will be running your first ROS 2 programs.

You Will Need

In order to complete this tutorial, you will need:

  • A computer or virtual machine running Ubuntu 26.04. If you followed my previous tutorial, you already have that setup.

Set the Locale

The official steps for installing ROS are at this link at ROS.org, but let’s go through this entire process together.

Follow along with me click by click, keystroke by keystroke.

We will begin by installing ROS 2 Lyrical via Debian Packages. Debian packages are software files used to install programs and applications on Ubuntu.

Open a new terminal window.

Type this command inside a terminal window.

locale

A locale is a set of variables that define the language, country, and character encoding settings. These settings are used by applications to determine how to display text, dates, times, and other information.

Now type the following command:

sudo apt update && sudo apt install locales

“sudo apt update” updates the package index list. This list is a database of all the software packages available for your version of Ubuntu.

“sudo apt install locales” installs the locales package, which provides support for different languages and regions.

Now type the following commands into the terminal window to generate locale definition files. After each command, press Enter on your keyboard:

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

In this case, these commands are generating locale definition files for the English (United States) locale and the English (United States) UTF-8 locale. The UTF-8 locale is a special locale that supports the UTF-8 character encoding, which is the standard encoding for most languages.

Now we need to verify the settings by typing:

locale

Here is what you should see:

1-locale

Enable the Required Repositories

Let’s add the ROS 2 apt repository to our system. APT stands for “Advanced Package Repository”. This repository provides a convenient way to install and manage ROS 2 packages without having to clone packages to your computer from GitHub and build them from that source code.  

Open a terminal window, and type the following two commands:

sudo apt install software-properties-common
sudo add-apt-repository universe

Press Enter.

The software-properties-common package provides a number of tools for managing software sources on Ubuntu and Debian systems. 

The universe repository is a software repository that contains a wide variety of software packages, including many that are not included in the default Ubuntu and Debian repositories. 

Now we need to tell your computer where to find the ROS 2 software, and we need to add the ROS 2 GPG key. The GPG key makes sure the software packages you are installing are from a trusted source.

Type this command:

sudo apt update && sudo apt install curl -y

That installs curl, a little program that downloads files from the internet.

Now type this command to download the ROS 2 setup file (copy and paste all of this below):

curl -L -o /tmp/ros2-apt-source.deb https://github.com/ros-infrastructure/ros-apt-source/releases/download/1.2.0/ros2-apt-source_1.2.0.resolute_all.deb

What does this do? It downloads one small file and saves it in your /tmp folder. That file contains the address of the ROS 2 software repository and the GPG key that goes with it. The word “resolute” in the file name is the nickname for Ubuntu 26.04, so this is the right file for the version of Ubuntu we are using.

Now install that file by typing:

sudo dpkg -i /tmp/ros2-apt-source.deb

Your computer now knows where to download ROS 2 from, and it trusts the packages it finds there. In older versions of ROS 2, you had to download the key yourself and then type out the repository address by hand. You do not have to do any of that anymore.

Type the following command to install ROS 2 development tools.

sudo apt update && sudo apt install ros-dev-tools

Upgrade the packages on your system to make sure you have the newest versions.

sudo apt upgrade -y

Install ROS 2

Now for the fun part. Here is where we get to install ROS 2 Lyrical. 

Open a terminal window, and type this command:

sudo apt install ros-lyrical-desktop

Set Up the Environment Variables

Once Lyrical has finished installing, you need to set up the important environment variables. Environment variables are settings that tell your computer how to find and use ROS 2 commands and packages.

Open a terminal window, and type this command:

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

When you run this command, it appends the line source /opt/ros/lyrical/setup.bash to your ~/.bashrc file

What does this do? Each time you open a new terminal window, you are starting what is called a bash session. The bash session needs to know what version of ROS 2 you are using. 

By adding this line (echo “source /opt/ros/lyrical/setup.bash”) to your ~/.bashrc file, you ensure the necessary environment variables and paths for ROS 2 Lyrical are properly set up each time you open a new terminal window, allowing you to use ROS 2 commands and tools without having to manually run the setup.bash script every time.

For the changes to take effect, you now need to open a new terminal window, or you can type this command in the current terminal:

source ~/.bashrc

You can verify that line was added by typing:

sudo apt-get install gedit -y
gedit ~/.bashrc

Close the gedit window.

Check Your ROS 2 Version

Now let’s see what ROS 2 version we are using using:

printenv ROS_DISTRO

You should see “lyrical”.

You can also type:

env | grep ROS

Finally, you can also type:

echo $ROS_DISTRO

Set up the system to manage ROS package dependencies.

sudo rosdep init
rosdep update

One thing worth knowing: if sudo rosdep init has already been run on this machine, running it a second time prints an error saying the default sources list file already exists. That error is harmless. Your rosdep setup is already in place, so just go ahead and run rosdep update.

Install Gazebo and Other Useful Packages

Let’s install some other useful packages like pip (the Python package manager), Gazebo, a simulation software for robotics, and NumPy, a scientific computing library for Python.

sudo apt-get install python3 python3-pip -y
sudo apt-get install ros-${ROS_DISTRO}-ros-gz -y
sudo apt-get install python3-numpy

A note on Gazebo versions. ROS 2 Lyrical pairs with Gazebo Jetty (gz-sim 10), where the previous release paired with Gazebo Harmonic (gz-sim 8).

You do not need to add the separate Gazebo apt repository: on Lyrical, Gazebo arrives as ROS vendor packages straight from packages.ros.org, and ros-lyrical-desktop already pulls Gazebo Jetty in on its own. The ros-gz package you just installed is the bridge between ROS 2 and Gazebo.

You can check which version you got by typing:

gz sim --versions

On my Ubuntu 26.04 machine, that prints 10.5.0.

Test Your Gazebo Installation

If you want to run an example Gazebo simulation world now, open a new terminal window, and type:

gz sim -v 4 shapes.sdf

Now test your Gazebo installation again by typing the following command:

gz sim

You should see this screen.

4-see-this-screen

Click on the NAO Joint Control simulation, and click Run.

5-nao-simulation

Close the simulation by typing CTRL + C in the terminal window.

Now try the Panda Joint Control World.

gz sim

Click on the Panda Joint Control World simulation, and click Run. It might take up to 60 seconds to load. Just be patient and don’t quit Gazebo if asked.

6-panda-joint-control-world

Close the simulation by typing CTRL + C in the terminal window.

Now run another example:

gz sim shapes.sdf -v 4

Close the simulation by typing CTRL + C in the terminal window.

Now let’s run the same shapes example using a ros2 command (source: official Gazebo ROS 2 GitHub repository):

ros2 launch ros_gz_sim gz_sim.launch.py gz_args:="shapes.sdf"
7-shapes-sdf

Close the simulation by typing CTRL + C in the terminal window.

Test Your ROS 2 Installation

Now that we have tested Gazebo, let’s test our ROS 2 installation by running some sample programs.

Open a terminal window, and type:

ros2 run demo_nodes_cpp talker
9-talker

This command runs a pre-built program called “talker” that comes with ROS 2. The “talker” program publishes messages to the ROS 2 system in string format. 

Open another terminal window, and type:

ros2 run demo_nodes_py listener
10-listener

If your output looks similar to the images above, you have installed ROS 2 successfully. 

To close these programs, press CTRL + C on your keyboard in both terminal windows.

So what did we just do here, and what do these two hello world programs we just ran have to do with real robots?

So imagine you’re building a robot that needs to navigate through a room. The “talker” program is like a sensor on the robot (e.g., a depth camera for example) that constantly sends out information about what it sees. 

The “listener” program, on the other hand, receives the information that was published by the talker program. This listener program, in a real robot, could do something with that data like stop the wheels if an obstacle is detected by the camera.

The talker program is what we call in ROS 2, a publisher. The listener program is called a subscriber. Remember those two terms. Those are the two most important terms in all of ROS 2. 

A ROS 2 publisher sends data, and a subscriber receives data. 

In future tutorials, we will create our own publishers and subscribers for actual robots. 

Publishers and subscribers are the main way programs exchange information with each other inside a robot.

So, again, just remember this…publishers are programs that send data to other programs, and subscribers are programs that receive data from other programs. All these programs are usually written in either Python or C++.

Collectively, publishers and subscribers in ROS 2 are called nodes. You just saw how to run a publisher node named talker and a subscriber node named listener.

The term node is the third most important term in all of ROS 2. So remember it because you will be using that term again and again over the course of your work with ROS 2.

To close out this tutorial, let me show you a cool program that enables you to show multiple terminal windows in a single window.

The program is called terminator.

Open a terminal window, and type:

sudo apt-get install terminator -y

Now type:

terminator

Right-click on the screen, and click “Split Horizontally”.

11-split-horizontally

On the top panel, type:

ros2 run demo_nodes_cpp talker

On the bottom panel, type:

ros2 run demo_nodes_py listener

Now, press Enter in both terminals.

Here is what you should get:

12-terminator

Press CTRL + C in both terminal windows to close everything.

That’s it! Keep building! I’ll see you in the next tutorial.

How to Install Ubuntu 26.04 Virtual Machine on a Windows PC

In this tutorial, you will install Ubuntu and Virtual Box on your personal computer. Whether you have a computer using Windows or a Mac, by the end of this tutorial, you will have Ubuntu all setup and ready to go.

What is Ubuntu?

Ubuntu is an operating system for your computer, just like Windows or macOS, but it is based on Linux –  a free, open-source system that serves as the foundation for many computer programs. 

Ubuntu provides a user-friendly desktop environment see in the lead image for this blog post. 

Why use Ubuntu to program robots when we could use Windows or macOS?

Three reasons:

  1. It is free to use.
  2. It is open source, which means the code is publicly available for you to modify and distribute without paying thousands of dollars in license fees.
  3. It is fully supported by ROS 2, the most popular framework in the world for writing robotics software.

What is VirtualBox?

VirtualBox is a program that lets you run a different operating system inside your current one. It is like having a computer within your computer. 

VirtualBox creates a safe, isolated space where you can experiment with other operating system environments without changing anything on your main Mac or Windows-based computer.

What About a Real-World Robotics Project?

On a real-world robotics project, you will use a small computer instead of your desktop PC. Examples include the Intel NUC, Raspberry Pi, or NVIDIA Jetson boards. 

These small computers serve as your robot’s “brain,” taking care of all the decisions on what actions the robot should take based on data from sensors like cameras, LIDAR, wheel encoders, and GPS. 

We’ll be harnessing the power of Ubuntu on a desktop computer, creating a robust virtual environment for our robotics journey. This setup is not just a convenient starting point for beginners—it is actually the ideal platform for any robotics project, regardless of experience level. 

Why Simulation Matters in Professional Robotics

It is worth mentioning that even in professional robotics jobs, a significant amount of work is done in simulation environments similar to what we’re setting up. There are three reasons for this: Speed, Spend, and Safety. I call it the three S’s:

  1. Speed: You can rapidly prototype new ideas in a simulated environment before committing to physical builds.
  2. Spend: Developing and testing in a virtual environment is much cheaper than building and testing physical prototypes for every iteration.
  3. Safety: You can test potentially dangerous scenarios without damaging expensive hardware or running into people:
    1. An example would be testing a cliff sensor for a mobile robot that is designed to keep the robot from falling down stairs. 
    2. You wouldn’t want to test that logic on a real robot without doing it in simulation first!

By starting with this virtual Ubuntu setup, you’re not only learning the basics but also preparing yourself for practices used in real-world robotics development. This approach bridges the gap between beginner-friendly learning and professional-grade tools and methodologies.

Download the Ubuntu Image

Now let’s download Ubuntu. 

First, go to the Ubuntu Releases page (https://releases.ubuntu.com/) on the Ubuntu website to find the latest version of Ubuntu that has long term support (LTS). 

As of the date of this writing, the latest version is Ubuntu 26.04 LTS (Resolute Raccoon).

Click on “Ubuntu 26.04 LTS (Resolute Raccoon)”.

Click on the 64-bit PC (AMD64) desktop image.

This .iso file is large. It will take a while to download. Just go do something else and come back to it when it is finished.

When the download finishes, you can either keep the file in the default download location, which for me is my Desktop. Or, you can move the file to another directory on your computer.

Now, go to the next step.

Install VirtualBox

Let’s install VirtualBox. 

Go to the VirtualBox downloads page. Here is the link.

Select the version that is compatible with your computer. I will click “Windows hosts” since I am using a Windows-based computer.

Click on the executable file that you just downloaded. 

Follow the prompts to install it on your machine. 

Accept all the defaults by clicking either Next, Yes, Install, or Finish through all the prompts.

You can find detailed installation instructions for all operating systems (Windows, Mac OS, and Linux) in the instruction manual if you encounter problems.

When you are finished downloading and installing VirtualBox, you can delete the original executable file that you used to install the program. You don’t need it anymore.

Create a Virtual Machine

Now that VirtualBox is installed, we need to create a new virtual machine using the Ubuntu image we downloaded earlier.

Open Virtual Box.

Click the New button in the toolbar.

4-click-new-button

Name and Operating System

First, let’s complete the “Name and Operating System” section.

On the “Name” line, type in a descriptive name for your operating system. I will call mine “Ubuntu26.04”.

On the “Folder” line, you can keep the default Folder path. This folder is where your virtual machines will be stored. 

On the “ISO Image” line, select the path to the Ubuntu .iso file you downloaded earlier.

On the “Type” line, select Linux.

On the “Subtype” line, select Ubuntu.

On the “Version” line, select Ubuntu (64-bit).

Select “Skip Unattended Installation”. By selecting this option, we will manually go through the entire installation process of the operating system. 

Click Next.

Hardware

Click on the arrow next to “Hardware” to expand the menu options.

6b-hardware-options

On the “Base Memory” line, move the slider to 16384 MB (megabytes). This memory size will be enough for us to run our robotics simulator, Gazebo, which requires a lot of memory.

On the “Processors” line, select 8 CPUs. If your computer supports it, you can set a higher number. I like to make sure my slider stays within the safe, green color to avoid problems.

Click Next.

Click on the slider bar under “Create a Virtual Hard Disk Now” to set 75.00 GB for the storage space. ROS 2 Lyrical, Gazebo Jetty, and a full development workspace take up a lot of room, so give yourself the extra space now. Resizing a virtual hard disk later is a headache you do not want.

Click Next.

Click “Finish”.

Highlight Ubuntu26.04, and click Settings.

Click Display.

Change Video Memory to 128 MB (megabytes).

Click OK.

Install Ubuntu

Highlight Ubuntu26.04, and click Start on the top menu.

A startup window will appear.

Select “Try or Install Ubuntu” by Pressing Enter.

Wait for a few minutes for the desktop to come up. Ignore any weird warnings on your screen.

Choose your language. I will select “English”.

9-choose-language

Click Next.

On the “Accessibility in Ubuntu” panel, click Next.

10-accessibility-in-ubuntu

On the “Keyboard layout” panel, select your desired keyboard layout, and click Next.

11-select-keyboard-layout

On the “Connect to the internet” panel, select “Use wired connection”, and click Next.

12-connect-to-the-internet

On the “What do you want to do with Ubuntu?” panel, select “Install Ubuntu”, and then click Next.

13-install-ubuntu

On the “How would you like to install Ubuntu?” panel, select “Interactive installation”, and then click Next.

14-interactive-installation

On the “What apps would you like to install to start with?” panel, select the “Default selection”, and then click Next.

15-what-apps-start-with

On the “Install recommended proprietary software?” panel, select both checkboxes, and then click Next.

16-install-recommended

On the “How do you want to install Ubuntu?” panel, select “Erase disk and install Ubuntu”.

17-how-want-install-ubuntu

Click Next.

On the Encryption and file system page, select “No encryption”.

Click Next.

On the “Create your account” panel, fill in your information with your desired name (e.g. “ubuntu”). Also fill in your password.

18-create-your-account

Deselect “Require my password to log in”.

Click Next.

Select your time zone, and then click Next.

19-select-your-timezone

On the “Review your choices” panel, click Install.

20-review-your-choices

Sit back and relax while Ubuntu installs.

Click “Restart now” when the installation finishes.

When you see a message that says “Please remove the installation medium, then press Enter”, press Enter on your keyboard.

22b-remove-installation-medium

Configure Ubuntu

You will now see a welcome screen.

Click Next.

On Location Services, click Next.

Click Next, on the “Help Improve Ubuntu” panel.

Click Next, on the “Choose how Ubuntu looks” panel.

On the “Get started with more applications” panel, click Finish.

25-click-finish

On the bottom left side of the screen, click the ring icon.

26-click-icon

Right-click the terminal icon, and click “Pin to Dock”.

Click the ring icon again to return to the Desktop.

Now let’s make sure your user has sudo privileges. Sudo privileges allow a user to execute commands with superuser (administrative) rights, enabling them to perform tasks that require higher levels of access on the system. 

Click the terminal icon on the left side of the screen.

30-terminal-icon

Type the following command inside the terminal window, and press Enter.

whoami

This is your username. It should say “ubuntu”.

Now type:

sudo adduser <username> sudo

Replace <username> with your username.

31b-add-sudo-user

Now shutdown the virtual machine by typing the following command and pressing Enter on the keyboard.

sudo shutdown -h now

Install VirtualBox Guest Additions

Now we need to install VirtualBox Guest Additions. 

VirtualBox Guest Additions are a set of applications that improve the performance and usability of virtual machines.

Highlight Ubuntu26.04, and click Start on the top menu to launch the Desktop environment.

Open a terminal window, and type the following commands to upgrade the operating system software packages:

sudo apt-get update -y

When prompted for the password, type in your password and press Enter.

sudo apt-get upgrade -y

Clear out all the logs in the terminal by typing the following command, and pressing Enter:

clear

When you get back to the Desktop, open a terminal window, and type the following command.

sudo apt install build-essential dkms linux-headers-$(uname -r) -y

Next, go to the menu bar at the top of the Virtual Machine.

Click “Devices”.

Click “Insert Guest Additions CD image” to mount the Guest Additions ISO file inside your virtual machine.

Click the Files icon on the left side of the screen.

32-click-files-icon

Click VBox_GAs on the left panel.

33-vbox-gas

Click Run Software at the top.

34-run-as-program
34-run-software

Click Run.

When that is done, type:

reboot

Change the Screen Resolution

Go the the top and click View.

Go to Virtual Screen 1.

Select Scale to 125% to enlargen the window.

You can also click the Settings button in the left side. It is the gear icon.

Click Displays.

Change Resolution to 1920 x 1080, and click Apply.

Congratulations, you have finished installing and setting up Ubuntu. 

I will see you in the next tutorial!

5 Robotics Problems No One Has Solved (Yet)

We see incredible demos of robots doing backflips, but the reality is that some of the simplest human tasks remain impossible for machines.

In this video, I break down the 5 biggest unsolved problems in robotics, from dexterous manipulation to the economics.

The future of robotics isn’t about hype; it’s about solving these fundamental challenges.