Firstly, take a backup of software selections in dpkg:
sudo dpkg --get-selections > ~/softwarelist
Install your new Ubuntu then:
sudo dpkg --set-selections < ~/softwarelist sudo apt-get -f install
It might whinge about dependencies or other libs not installed if they came from elsewhere, but it should generally work if it's the same version of Ubuntu (say 16.04 to 16.04 and not 16.04 to 15.10).