I think you can get the restricted extras package from the Ubuntu software repository (no terminal commands needed).
Once the restricted extras are installed, open terminal and enter the following...
That worked for me anyways.
awww... newb85 beat me to it
Also which ubuntu flavor are you using? There are different packages for different 'buntus...
If you are using regular, stock Ubuntu:
If you are using Kubuntu:
sudo apt-get install ubuntu-restricted-extras
If you are using Xubuntu:
sudo apt-get install kubuntu-restricted-extras
If you are using Lubuntu:
sudo apt-get install xubuntu-restricted-extras
sudo apt-get install lubuntu-restricted-extras