root@debian:~# dpkg --get-selections > packages.dpkg
root@debian:~# apt-get install gnome-session
root@debian:~# dpkg --clear-selections
root@debian:~# dpkg --set-selections < packages.dpkg
root@debian:~# apt-get deselect-upgrade