PATH_TO_STORE="/root/packages"
FILE_TO_STORE="installed_packages.txt"
dpkg --get-selections | awk '{ if ( $2 == "install" ) print $1 " " $2 }' > $PATH_TO_STORE/$FILE_TO_STORE
MAC OS X, Linux, Windows and other IT Tips and Tricks
PATH_TO_STORE="/root/packages"
FILE_TO_STORE="installed_packages.txt"
dpkg --get-selections | awk '{ if ( $2 == "install" ) print $1 " " $2 }' > $PATH_TO_STORE/$FILE_TO_STORE