Sep 12, 2009

HOWTO Reinstall all of your current packages if you do a fresh Debian install

According to section 2.7.13. Recording and copying system configuration of the Debian Reference Manual, the following will save both the list of packages installed and their debconf configuration:

Code:

# dpkg --get-selections '*' > selection.dpkg
# debconf-get-selections > selection.debconf

Here, "*" makes "selection.dpkg" to include package entries for "purge" too.

You can transfer these 2 files to another computer, and install there with the following.

Code:

# dselect update
# debconf-set-selections < myselection.debconf
# dpkg --set-selections < myselection.dpkg
# apt-get -u dselect-upgrade # or dselect install
If you are thinking about managing many servers in a cluster with practically the same configuration, you should consider to use specialized package such as fai to manage the whole system.