Introduction
Here you’ll be installing ROS indigo (which is just a distribution of ROS, like Ubuntu is a distribution of Linux). I recommend ROS indigo because it is the most stable version to date and will have support until 2019. It also supports the latest version of Ubuntu.
Setup your sources.list
Setup your computer to accept software from packages.ros.org. ROS Indigo ONLY supports Saucy (13.10) and Trusty (14.04) for Debian packages.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu (lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
Set up your keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
You can try the following command by adding :80 if you have gpg: keyserver timed out error
sudo apt-key adv –keyserver hkp://ha.pool.sks-keyservers.net:80 –recv-key 0xB01FA116
Installation
First, make sure your Debian package index is up-to-date:
sudo apt-get update
Now for the magic line
sudo apt-get install ros-indigo-desktop-full
If doing all that returns an error, try copy pasting this entire section into your terminal.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list' wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add - sudo apt-get update sudo apt-get install ros-indigo-desktop-full
Initialize rosedp
The ROS system may depend on software packages that are not loaded initially. These software packages external to ROS are provided by the operating system. The ROS environment command rosdep is used to download and install these external packages. It’s kind of like the way you use sudo apt-get install, except since ROS is a different operating system, you use this.
Type the following command:
sudo rosdep init rosdep update
Setup ROS environment
source /opt/ros/indigo/setup.bash
Sometimes it’s easier if the variables are automatically added to your sessions every time a new shell is launched. Do so by typing the following command into terminal.
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc source ~/.bashrc
Rosinstall
This is the kind of like the terminal, except for ROS packages.
sudo apt-get install python-rosinstall
For more help and troubleshooting, visit the official ROS website and for problems with setting up the environment, try http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment.