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