Before you go any further I seriously recommend backing up all your data, and all the hidden dot files in your home directory. To make a list of installed programs do:
dpgk --get-selections | grep -v deinstall > ubuntu-files
This will make a file in the current directory called ubuntu-files which will contain a list of everything that is installed. To restore this list to the system do the following:
### Make sure the system is fully updated if it isn't already:
sudo apt-get update && sudo apt-get upgrade
### Install the dselect tool (probably depracated)
sudo apt-get install dselect
### Give the package list to dpkg so it knows what to install
sudo dpkg --set-selections < ubuntu-files
### Use dselect to initiate installation (option 'I' will do it)
sudo dselect
Please note that this will install everything in the list you made in the first step. If you're doing this after upgrading the release level then the results may not be ideal - for example open office will may installed when the default for 12.04 should actually be Libre Office and so on.
To try to kick the distribution upgrade off again do the following:
### Make sure the package lists are up to date.
sudo apt-get update
### install update-manager-core if it is not already:
sudo apt-get install update-manager-core
### Kick the release upgrade off again...
sudo do-release-upgrade