This procedure is best for the server version of Ubuntu:
Edit /etc/apt/sources.list
Change the keyword "breezy" to "dapper".
Comment out any lines starting with "deb cdrom" with the pound sign (#).
sudo apt-get update
sudo apt-get -y dist-upgrade
For more information on the /etc/apt/sources.list file, see "Chapter 2 - Basic Configuration" in the APT HOWTO:
http://www.debian.org/doc/manuals/apt-howto/ch-basico.en.html