2

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?

Daniel W.
  • 1,439
  • 4
  • 23
  • 46

1 Answers1

3

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.

Martin
  • 490
  • 2
  • 5