Annex 3: INSTALLING ROS IN UBUNTU (x86 / x64 devices)

http://wiki.ros.org/indigo/Installation/Ubuntu

Installation

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://pool.sks-keyservers.net --recv-key 0xB01FA116

sudo apt-get update

# DO NOT EXECUTE THIS COMMAND ON THE FIRST INSTALLATION RUN
# Additional dependencies for 10.04-2 if experiencing dependency issues during the ROS installation
# Do not install these packages if you are using 14.04, it will destroy your X server
sudo apt-get install xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic libxatracker-dev-lts-utopic libopenvg1-mesa-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic libgl1-mesa-dev-lts-utopic libgbm-dev-lts-utopic libegl1-mesa-dev-lts-utopic
# Alternatively, try installing just this to fix dependency issues:
sudo apt-get install libgl1-mesa-dev-lts-utopic

# And now let's go with desktop installation
sudo apt-get install ros-indigo-desktop-full

# To find available packages (easier with the GUI provided by synaptics on Desktop)
apt-cache search ros-indigo

Initialize rosdep

sudo rosdep init
rosdep update

Environment setup

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

Getting rosinstall

rosinstall is a frequently used command-line tool in ROS that is distributed separately. It enables you to easily download many source trees for ROS packages with one command.

sudo apt-get install python-rosinstall

Create a catkin workspace

 mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace

Build the workspace

cd ~/catkin_ws/
catkin_make
source devel/setup.bash

And do the final checks

echo $ROS_PACKAGE_PATH
rospack profile