Posted by & filed under AWS/Linux/Unix/Devops stuff.

The following will generate a listing of installed Debian/Ubuntu packages, and will install packages from that list on another machine. Just make sure you have the same sources set in /etc/apt/sources.list:

dpkg --get-selections > package_list

scp package_list to your destination machine, and:

dpkg --set-selections < package_list
apt-get -u dselect-upgrade

to install these packages.