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

Re: Backup Image for my needs



On Wed, Dec 17, 2008 at 08:51:12PM -0800, Carl Johnson <carlj@peak.org> was heard to say:
> "Douglas A. Tutty" <dtutty@vianet.ca> writes:
> 
> > Here's what I do  (I'm on dialup).
> > 
> > 2.	backup to plain text:
> > 	selections from /etc including fstab, inittab, networks.
> > 	output of sfdisk (hard drive partitions) which can be fed
> > 		back to sfdisk to fix a busted partition table
> > 	output of aptitude search '~i !~A' which means all installed
> > 		packages which are not automatically installed.
> 
> Just because a package is automatically installed doesn't mean that it
> is the choice the package manager would choose.  For example many
> packages depend on www-browser, but which one is automatically
> installed?  You can use aptitude to select the one you want and then
> remove any other automatically installed one, but how will it know
> that if you install from that list later?

  What should work, probably, is (this is an outline and not a complete
list of commands):

  (a) save "aptitude search '~i'" and "aptitude search '~i~A'"

  (b) run "aptitude install -o 'Aptitude::Auto-Install=false'
                    $(cat list-of-installed-packages)"

  (c) run "aptitude markauto $(cat list-of-auto-packages)"

  If you exceed the maximum number of command-line arguments, which you
probably will, you can either break them up into batches or do some
hacks to feed them into the command-line prompt (which means you have to
figure out how to force the program to make a prompt).  Of course,
breaking the install runs up into batches would mean you have to
sort them topologically (the implementation of which is left to the
reader familiar with python-apt and Wikipedia).

  I suggest taking a very close look at what the program wants to do
before you press "y", though!  Also, this won't help you remove stuff
that's installed by default that you didn't have in the past.  And if
the package archive changes between backup and restore, well, good luck
with that...

  Daniel


Reply to: