Is it possible to export a list of packages from a (Debian) server,

so I can reuse this list and simply hit apt-get install <exported_package_list>

on a different server?

Can I also pipe a textfile to apt-get like apt-get install << list.txt?


Take a look at the --get-selections and --set-selections options to dpkg.

You export a list of current selections using dpkg --get-selections > my-selections.

In order to restore the selections you first need to run dpkg --set-selections < my-selections and then apt-get dselect-upgrade to actually install the packages. Be aware that this will only restore the installed packages, but not any configuration or choices made during the install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.