Step 1: Gather details on packages installed on the source machine
To get the list of all packages installed on the machine. The following command can be used. This one line script will get all the installed package and store them into a file.
$ sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" | sed