Hi there,

for a while now I have been thinking about how to backup/restore a system
efficienly (i.e. without having to dump *everything*, including binaires, into
the backup).
The idea that comes to mind is to somehow backup the package system's metadata
and restore it to the destination.
Then, 'aptitude install' or alike should do the trick.

Now this issue has been raised on debian-user again, and I definitely want to
get to the bottom of this.

To what we made it over there was something along the lines of 

# BACKUP
dpkg --get-selections | awk '$2 == "install"' > packagesNG_installed
aptitude -F '%p' search '~i~M' > packagesNG_autoinstalled
debconf-get-selections | grep -Ev '^[[:space:]]*(#|$)' > packagesNG_debconf

# RESTORE
aptitude update
aptitude upgrade
dpkg --clear-selections
dpkg --set-selections < packagesNG_installed
debconf-set-selections < packagesNG_debconf
xargs -r -- aptitude markauto < packagesNG_autoinstalled
aptitude install # maybe use -q -f -y ?

Now I haven't come to experiment on this a lot (I am currently mirroring the
needed packages to be able to do this efficiently).
Before I start, I thought asking here might help.
So: any thoughts? ;-)

Regards,
Mark


_______________________________________________
Aptitude-devel mailing list
Aptitude-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/aptitude-devel

Reply via email to