How to backup installed package list on Debian based systems
dpkg --get-selections > selections.txt save the .txt file to a safe place then once reinstalled
dpkg --set-selections < selections.txt followed by
dselect update and
apt-get dselect-upgrade should give you back your installed packages