[TAG] Backup software/strategies

Kapil Hari Paranjape kapil at imsc.res.in
Mon Jul 16 05:30:58 MSD 2007


Hello,

Since I was the one who suggested copying /var/lib/dpkg (but leaving
out /var/lib/dpkg/info) and /var/lib/aptitude, and since a number of
people are wondering why ...

On Sun, 15 Jul 2007, Ben Okopnik wrote:
> Wouldn't the first two lines take care of that already? I'm missing the
> purpose of copying /var/lib/ here.

On Sun, 15 Jul 2007, Rick Moen wrote:
> As am I.

On Mon, 16 Jul 2007, Thomas Adam wrote:
> Yep, and as for copying /var/lib -- it wasn't I who suggested it, so I can't
> say.  :)

... let me explain.

The directory /var/lib/dpkg/alternatives contains the alternatives
that you have chosen for the system by running update-alternatives.

The file /var/lib/dpkg/diversions lists all the diversions that you
have created for your system by running dpkg-divert.

The file /var/lib/aptitude/pkgstates lists which packages were pulled
in by automatic dependency checks.

So one way to restore your system if you *have* backed-up the
directories /var/lib/dpkg and /var/lib/aptitude would be:

	dpkg --get-selections ....
	rm /var/lib/dpkg/status
	dpkg --set-selects ...

An alternate approach would be to backup /var/lib/dpkg/alternatives
and /var/lib/dpkg/diversions. You can use "debfoster" to keep
track of package dependency and backup its (much smaller) file
/var/lib/debfoster/keepers.

Regards,

Kapil.
--




More information about the TAG mailing list