[balug-talk] cloning a Debian installation

Michael Paoli Michael.Paoli at cal.berkeley.edu
Fri Dec 8 13:36:27 PST 2006


dpkg --get-selections gives format much more suitable for
dpkg --set-selections
dpkg --list (or dpkg -l) is better suited for humans than for
feeding to dpkg --set-selections.  dpkg --list generally includes
headers and descriptions (which --set-selections doesn't want), and
dpkg --list will often truncate the names of the longer package names (if
one wants a dpkg --list format listing, without the longer package names
getting truncated, one can have a sufficiently large value of COLUMNS
set in the environment when dpkg --list is executed, e.g.:
$ COLUMNS=160 dpkg --list kdemultimedia-kappfinder-data
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                               Version                           
Description
+++-==================================-==================================-====================================================================================
ii  kdemultimedia-kappfinder-data      3.3.2-1                           
Multimedia data for kappfinder
vs.:
$ dpkg --list kdemultimedia-kappfinder-data
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  kdemultimedia- 3.3.2-1        Multimedia data for kappfinder
$ 
)

I'd also add an update before the upgrade.

Also, at least as of Debian 3.1 aptitude is supposed to be the prefefred
tool over apt-get (aptitude is mostly command-line argument compatible
with apt-get; apt-get was originally intended "just" to be a demonstration
of the apt library functionality and power, and apt-get was probably
never intended to have become as popular and heavily used as it became).

Sorry if I read these a bit out-of-order (attempting to catch up on a
backlog of e-mail).

Quoting Will Lowe:

> On the source machine:
> 
> dpkg --list '*' > file.list
> 
> Copy file.list and /etc/apt/sources.list to the target machine,  and then:
> 
> dpkg --set-selections < file.list
> apt-get -u dselect-upgrade


More information about the balug-talk mailing list