[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "automated" install/re-install from status file or package list



Andreas Hatz <ahatz@nemesis.com.au> wrote:
>Does anybody know of a good way of using an old /var/lib/dpkg/status
>file to quickly reinstall debian. I would like to be able to do this to
>reduce the amount of time it takes me to re-build a machine after an
>attack or for installing all the same packages as another web server
>instead of choosing all packages manually.
>
>I have tried the following (rather clumsy) method:
>
># grep -B1 -e "install ok"  /var/lib/dpkg/status 
>	\|grep "Package:" |cut -d" " -f2 > installed.packages
># apt-get install `cat installed.packages`
>
>This does not work as well as I first thought. plenty of "broken
>packages"
>
>This is a functionality of apt-get that would come in very handy I
>think.

You're better off using 'dpkg --get-selections > selections', and then
later 'dpkg --set-selections < selections; dselect install'.

Cheers,

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Reply to: