Install Robotics Operating System (ROS) on Ubuntu

Robot Operating System (ROS) is a set of libraries and tools for software developers to create robot applications. ROS can be installed on different platforms – Linux, Windows, OS X, and a number of others. ROS is licensed under an open source, BSD license.

This article describes how ROS can be installed on one of Linux distributions Ubuntu – for those who are not familiar with Linux.

1. Install Ubuntu

Currently ROS supports Ubuntu 10.04, 11.10, 12.04. Download and install distributive of Ubuntu 12.04.

hintWays of running Ubuntu

  1. Install Ubuntu within Windows – Ubuntu is installed inside Windows environment and can be uninstalled later by the operation “Add/Remove Program”. When computer starts – it can be selected which of operation systems should be booted.
  2. Boot the computer from USB or CD with Ubuntu and install it – Ubuntu will be installed on hard-drive. If Windows is installed – Ubuntu will be installed beside. When computer starts – it can be selected which of operation systems should be booted.
  3. Boot the computer from USB or CD with Ubuntu without installing it. This is the way to try out Ubuntu.

2. Install updates

Click on the icon “Update Manager” UbuntuUpdateManager to open the “Update Manager” dialog.

 hint How to find the 'Update Manager'

  1. Click on the icon “Dash Home” UbuntuDashHome or hit the “Win” key
  2. Type “update” in the search field – an icon “Update Manager” will be shown below UbuntuSearchUpdateManager

Click on the icon “Install Updates” in the opened dialog and wait till all updates are installed.

hint What if the computer cannot connect to exist Wi-Fi networks

It may happened the computer booted with Windows was connected to Internet by Wi-Fi but after installing and booting with Ubuntu the computer cannot connect to any Wi-Fi. Most likely Ubuntu needs activating or downloading the driver for the wireless network adaptor for it. There are options how to solve this:

Activate additional drivers
  1. Click on the icon UbuntuSystem in the top right corner of the screen.
  2. Select an item “System Settings…” in the drop-down menu to open a dialog “System settings”.
  3. Click on the icon “Additional Drivers” UbuntuAdditionalDrivers  to open a dialog “Additional Drivers”. A list on the top of this dialog may contain additional drivers which need to be activated.
  4. Select an item with a driver name and click on the button “Activate” beneath of the dialog. After the driver is activated it may require to restart the computer.
  5. After restarting the computer – click on the icon of network status UbuntuNetworkStatusDisconnected and check if there are wireless networks in the list. If so – click on the known network name and enter the prompted password. When the connection is established the status icon is changed UbuntuNetworkStatusConnected
Connect to network by wires
  1. Connect the computer by LAN cable to the network router or a network hub.
  2. Connect the computer by USB cable to a smartphone connected to Internet, if this smartphone has an option “Tethering” (on smartphones with Android – open main menu, select “System Settings”/”More..”/”Tethering…”, tick a checkbox “USB tethering”)
Connect to USB Wi-Fi adaptor
  1. Connect a USB Wi-Fi adaptor to the computer – some of them are supported with default drivers.
  2. When the system downloads and installs drivers for build in wireless adaptor – disconnect the USB Wi-Fi adaptor

3. Install ROS

Follow the original instruction or the instruction below. Commands in these instructions can be run in the application “Terminal”.

hint How to find the 'Terminal'

  1. Click on the button “Dash Home” UbuntuDashHome or hit the “Win” key
  2. Type “term” in the search field – an icon “Terminal” will be shown belowUbuntuSearchOfTerminal
  3. Another option – hit the key combination Ctrl+Alt+T

Setup the system to accept installation of ROS packages

sudo sh -c ‘echo “deb precise main” > /etc/apt/sources.list.d/ros-latest.list’

hint What is 'sudo'

sudo is a program which runs another program or command, put as a parameter, with permissions of a superuser. Superuser (or “root”) has permissions to modify critical system data so it is not save be always logged on as such user.

When the command is run – it prompts for the password which was required during installation.

Setup keys

sudo wget -O – | sudo apt-key add –

hint Redirection of program and command output

When a program (or a command) is run from the Terminal it can send its result to a next program/command or take the result of a previous one. To achieve this redirection symbol(s) are put between names of these programs/commands in the command-line

< – using a string or a file as an input for a program or command
> – using a file as an output for a program or command
>> – append output of a program or command to a file
| (known as “pipe”) – redirecting output of one program or command to input of another one without need in an intermediate temporary file


  • command “ps” with the parameter “-e” displays all processes in the system
  • command “grep” changes its input using parameter “dev” as a filter

Thereby the command “ps” redirects its output to the command “grep” which displays only processes with names containing “dev”

ps -e | grep dev


Update Debian package index

sudo apt-get update

hint What is 'apt-get'

“apt-get” is one of Advanced Packaging Tools for retrieval, configuring and installing/uninstalling software packages (or files and programs).


Installing of the popular editor “vim” ( vim is an improved version of an editor vi exist in the system by default)
sudo apt-get install vim

Uninstalling of “vim” – configuration files for this program are left in the system
sudo apt-get remove vim

Uninstalling of “vim” and remove all its configuration files
sudo apt-get purge vim

Install ROS package

sudo apt-get install ros-hydro-desktop-full

hint In which folder ROS is installed

ROS is installed in the folder /opt/ros/hydro where “hydro” is a name of the version of ROS distributive. Command roscd sets this folder as current.

In the Terminal run the command “ls” which displays list of subfolders and files in the current folder or the folder specified as a parameter

ls /opt/ros/hydro


Actually there are more files in this folder – by default the command “ls” does not display files and folders with names started with dot. To display such names the parameter “-a” is used

ls -a /opt/ros/hydro


Initialize rosdep

sudo rosdep init

rosdep update

Prepare initialization of environment variables

echo “source /opt/ros/hydro/setup.bash” >> ~/.bashrc

hint What is 'echo'

echo is a command which outputs a string from its parameter to a terminal. Using redirection symbol allows to send this string to another resource (e.g to a file). In the command below “echo” appends the string to a file “.bashrc” using symbol >>

Initialize ROS environment

source ~/.bashrc

hint What is 'source'

source as well as “. ” (a dot followed by a space) is a command which runs another program or script in current shell context. Thereby any environment variables added or modified in the current shell (e.g. in a started Terminal application)  will be available for a program or script which was run with “source”. In the command above a script from a file “.bashrc” is run within the environment of a current shell. Following command is equal (there is a space after the first dot!):

. ~/.bashrc

In contrast the following command will start a script with environment default for this shell


Install rosinstaller

sudo apt-get install python-rosinstall

hint What is 'rosinstaller'

rosinstaller is a tool to easily download many source trees for ROS packages. “rosinstaller” is distributed separately from ROS.

ROS is installed. There is list of tutorials to get familiar with ROS.

hint Navigation within folders and files


  1. Run the Terminal – click on the icon “Terminal” UbuntuTerminal or hit the key combination Ctrl+Alt+T
  2. Prompt with the cursor has following format:
  3. Command cd folder-name changes the current folder to specified as folder-name in the parameter
  4. Command ls folder-name displays the content of the folder specified as folder-name in the parameter. The command ls without parameters – displays the content of the current folder

There are predefined folder names:
. – “single dot” refers to a current folder ( ./ “single dot followed by slash” is the same).
.. – “double dot” refers to a parent folder ( ../ “double dot followed by slash” is the same).
/ – “slash” refers to a root folder of the system.
~ – “tilda” refers to a “home” folder of the logged user – with subfolders “Documents”, “Downloads”, “Pictures”, etc. ( ~/ – “tilda followed by slash” is the same).

File explorer

  1. Click on the icon  to open file manager window UbuntuFileExplorer
  2. Item “Home” on the left panel of the file manager window refers to a “home” folder of the logged user
  3. The way to easy change of a size of a window – keep the key Alt and the middle mouse button pressed when the mouse cursor is near the border or a corner of a window and move the mouse cursor.

Two panel file commanders

  1. Click on the icon “Ubuntu Software Center” UbuntuSoftware Center
  2. Type “file commander” in the search field
  3. Select the program in the list and click on “Install” button

UbuntuSoftware CenterFileCommander

“Midnight Commander” is a well known text terminal based file manager. Hit a key combination Ctrl+O to hide/show panels.


“GNOME Commander” is a more modern GUI based file manager with useful features.

UbuntuGNOME Commander