Robot Operating System: Installation Instructions for Ubuntu
Tags: ros, ubuntu
Published: 2021-11-22 06:19:30

The Robot Operating System ROS is provided as several Debian packages. Installation instructions specifically target the Ubuntu distribution. If you want to get ROS running, its best to do so on an Ubuntu system. But what to do if you cannot use Ubuntu or have another operating system like OsX?

This article is an essential description of how to get the Robot Operating System running. If you use Ubuntu, install it natively. If not, I recommend to install  VM with a virtualization software of your choice. Just follow the steps outlined in the next sections, and you will have a fully working ROS system.

![](https://admantium.com/images/blog/ros02_ubuntu_workspace.png)

_This article originally appeared at my blog [admantium.com](https://admantium.com/blog/ros02_setup_ros_with_ubuntu/)_.

## Setup Ubuntu in a VM

The official ROS [installation manual](https://wiki.ros.org/noetic/Installation) lists installation steps for  Linux (Debian, Ubuntu, Arch Linux), Windows 10 and Mac OsX. But as I mentioned in the introduction, from my experience the compatibility of ROS packages is best in Ubuntu Linux.

Therefore, if you do not have a spare PC, I recommend to get VMWare Fusion player with a free license, and then install Ubuntu as a VM:

1. Get a free key for [VMware Fusion Player](https://my.vmware.com/web/vmware/evalcenter?p=fusion-player-personal)
1. On the same page, download VMware Fusion player for your operating System
1. Install VMware Fusion Player
1. Get the [Ubuntu 20.04 ISO](https://linuxconfig.org/ubuntu-20-04-download)
1. Install Ubuntu as a VMware virtual machine

VmWare Fusion Player feature a comfortable auto installation mode in which you don't need any manual interactions. After a short amount of time, the VM is ready and you can continue to install ROS.

## Setup ROS

On your Ubuntu machine, follow these steps to install [ROS Noetic](https://wiki.ros.org/noetic/Installation/Ubuntu):

1. Add the ROS package repository to your `sources.list`, and import the required keys.

```bash
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
```

2. For maximum compatibility of your system with the tutorials and other systems, make a  _Desktop Full Install_ of ROS

```bash
sudo apt update && sudo apt install ros-noetic-desktop-full
```

3. Install additional packages:
  
```bash
sudo apt install liburdfdom-tools ros-noetic-robot-state-publisher
```

## Starting ROS

When all packages are installed, it's time to test the installation.

1. Run the following command to export additional path variables in your shell, so that you can execute all the ROS binaries

```bash
source /opt/ros/noetic/setup.bash
```

2. Start a demo of the simulation tool gazebo

```bash
roslaunch walker_gazebo walker.launch
```

3. If you see the GUI application starting - like in the following picture - your installation is complete.
  
![](https://admantium.com/images/blog/ros02_gazebo_tool.png)

4. Now permanently add the new new env vars to your shell with

```bash
echo '`source /opt/ros/noetic/setup.bash`' > ~/.bashrc
```

Congrats! ROS is installed, and you can proceed with one of the many tutorials.

## Conclusion

This short article showed the essential steps to install the Robot Operating System. After trying an Installation on OsX, I can only recommend to use an Ubuntu System – either on a spare PC, or on a Virtual Machine – to achieve maximum capability and in order to use all ROS packages.