One issue people run into when attempting to upgrade is conflicts with software installed from sources other than Ubuntu. If you "clean" your system by removing this software first, the upgrade will often go more smoothly, and the extra software can be reinstalled later .
This process only works for software installed via packages (.deb files, installed with apt, synaptic, gdebi, etc.) If you installed anything via other means (.tar.gz, .bin, etc.) it will have its own means of uninstallation.
Preparing for the Upgrade
Update the System
Make sure you have downloaded and installed all updates through the Update Manager.
Remove Obsolete Packages
Start Synaptic. Click on the Status button in the lower left, then Installed (local or obsolete) in the list above. The package list on the upper right will list all the packages that Synaptic does not know about. Normally this will be quite short and may even be empty. You will not be able to reinstall these packages without figuring out where they came from! Make a note of any packages that you want to have after the upgrade, then remove all the obsolete packages (right-click, Mark for Complete Removal, then click the Apply button at the top.)
Remove Third-Party Packages
Select Filters from the Settings menu. Click New and name the filter Installed Third Party (at the top). On the Status tab, make sure only Installed is selected.
Under Section, choose Exclude Selected Sections and make sure nothing is selected.
Finally, under Properties, click New, choose Origin from the drop-down, select Excludes, and type .ubuntu.com (don't forget the leading .). In some versions of Synaptic, you may need to choose OR under Boolean operator between property criterias.
Back in the main Synaptic window, choose Custom Filters on the lower left and Installed Third Party in the list above. (Again, it is possible that this list will be empty.) Make a note of the listed packages ("to reinstall later"), then remove them all (right-click, Mark for Complete Removal, then click the Apply button at the top.) Be very careful at this step. If marking something for removal results in a long list of packages that will be removed, do not mark it for removal just yet and write its name down as a "problem package". This sometimes happens if you're using a PPA that provides a different version of software that Ubuntu needs to work properly.
Choose Repositories from the Settings menu. Click on the Third-Party Software tab. Make sure that nothing is selected (all the checkboxes are empty.) Click Close. You may receive a messages that the repositories changed; click Close on that window. Now click Reload in the main Synaptic window.
Install Standard Ubuntu Components
Reverting Nonstandard Versions
If you had no "problem packages" above, skip to "Install ubuntu-desktop" below. Otherwise, click Status in the lower left and Installed (local or obsolete) above. Your problem packages should show up here. You have the option of ignoring this and trying to proceed with the upgrade or trying to fix it. Either way may cause problems
If you elect to fix it, click on the package's name and choose Force Version... from the Package menu. There should be two options: choose the one that is not labelled (now) and click Force Version. (If there are not exactly two options, click Cancel...fixing it will not be easy so it's best just to proceed.) Click Apply.
Now choose All in the left pane and search for ubuntu-desktop (if you are on a server, search for ubuntu-standard). If this package is not already installed, right-click, Mark for installation. Click Mark on the window that pops up, then click Apply in the main Synaptic window. This may take a while.
Perform the Upgrade
Run Update Manager and upgrade.
Reinstall third-party software
Run Synaptic. Choose Repositories from the Settings menu. Click on the Third-Party Software tab. Re-enable the repositories you want to use; you may need to edit them and change Distribution to your newly-updated version of Ubuntu (e.g. change jaunty to karmic if updating from Ubuntu 9.04 to Ubuntu 9.10.)
Now reinstall whatever software you would like from your "to reinstall later" list.