Install LaTeX in Ubuntu

Note Updated to work with Ubuntu 10.04 and TeXLive 2009-7.

As with my other guides this is made as a reference that I can always go back to in case I should suffer from a case of instant amnesia. Installing LaTeX in Ubuntu is actually quite straightforward, but this guide is a good entry point for other LaTeX tips.
I assume that Ubuntu is already installed on the target machine.
  1. Make sure that Ubuntu is fully updated by running the Update Manager from theSystemAdministration menu.
  2. Install LaTeX by entering the following in a Terminal. I usually install the full distribution; it has the advantage that you most likely don't have to install any packages afterwards, but at the cost of disk space - it installs more than a gigabyte of fetish rubber packages (as in typesetting fetish ;) including language packages that you will probably never need. You may need to enter your password to execute the command.
    $> sudo apt-get install texlive-full
    Alternatively you can select to install a complete distribution that only includes the language packages you need by specifying each package to install
    $> sudo apt-get install texlive-base texlive-binaries texlive-common texlive-latex-base texlive-publishers texlive-music texlive-latex3 texlive-generic-recommended texlive-omega texlive-font-utils texlive-plain-extra texlive-formats-extra texlive-games texlive-metapost texlive-generic-extra texlive-pictures texlive-math-extra texlive-extra-utils texlive-latex-recommended texlive-bibtex-extra texlive-humanities texlive-fonts-recommended texlive-pstricks texlive-science texlive-fonts-extra-doc texlive-latex-base-doc texlive-doc-base texlive-latex-recommended-doc texlive-humanities-doc texlive-pstricks-doc texlive-science-doc texlive-metapost-doc texlive-pictures-doc texlive-latex-extra-doc texlive-publishers-doc texlive-fonts-recommended-doc texlive-doc-en texlive-lang-danish texlive-lang-ukenglish texlive-lang-german texlive-lang-french texlive-lang-greek feynmf tex4ht tex4ht-common texinfo tex-common libkpathsea5 libkpathsea-dev pgf dvipng latex-xft-fonts xfonts-mathml musixtex musixlyr latex-sanskrit latex-xcolor lacheck ps2eps latex-beamer cm-super cm-super-minimal context musixtex-slurps preview-latex-style prosper tipa lmodern lcdf-typetools
    Note that the above installs language packages for Danish, Greek, German and French (English is part of the standard distribution and is always installed).
  3. Now you have a full working LaTeX distribution installed and you can compile your LaTeX document by running
    $> pdflatex filename.tex
    That is actually how simple it is. I usually use either gedit (part of Ubuntu installation) or Eclipse (can be installed using the Synaptics Package Manager or apt-get) to write LaTeX documents, but you can use whichever plain text editor you prefer