Tue, 10 Jun 2008

Mirroring Debian Installs

Problem: You need to ensure a consistent set of packages across boxes

Solution

Debian makes it remarkably easy to make sure you have the asme software across boxes, as you might need to do for mirrored high availability boxes, for instance.

First set up one box so you have the set of packages you require.It takes three steps

  1. dpkg --get-selections [>dpkg.out]
  2. [cat dpkg.out] | sudo dpkg --set-selections
  3. dselect install
  4. The first step takes place on the master box with the setup, the other two on the new, target box

    to brake it down a little more:
    Step 1 outputs a list of installed packages, this is fed as STDIN to dpkg --set-selections on the target box which gives it a list of packages that the third step then actually installs. You can do this all with one command line
    code>dpkg --get-selections | ssh root@newbox dpkg --set-selections; ssh root@newbox dselect install'

    hat tip to Aaron Trevena. This is all derived form an email he sent to the posted at: 15:44 | path: / | permanent link to this entry