- At the Old environment, do this:
$ sudo dpkg --get-selections "*" > packages.txt
- After copy that packages.txt to the New environment, do these following.
$ apt-cache dumpavail > tmpdump
$ sudo dpkg --merge-avail tmpdump
$ sudo dpkg --set-selections < packages.txt
$ sudo apt dselect-upgrade
$ rm tmpdump
That's all.