Configure your Ubuntu repositories
Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guide for instructions on doing this.
Setup your sources.list
Setup your computer to accept software from packages.ros.org. ROS Groovy does not support Lucid, Maverick or Natty.
Ubuntu 11.10 (Oneiric)
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu oneiric main" > /etc/apt/sources.list.d/ros-latest.list'
Ubuntu 12.04 (Precise)
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
Ubuntu 12.10 (Quantal)
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu quantal main" > /etc/apt/sources.list.d/ros-latest.list'
Set up your keys
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -