Fresh install?

Derek Broughton news at pointerstop.ca
Thu Oct 16 13:51:18 UTC 2008


David McGlone wrote:

> On Wednesday 15 October 2008 1:51:34 pm Derek Broughton wrote:
>> Paul Lemmons wrote:
>>
>> > Why the constant advice to
>> > backup your system, remember all of the apps you installed and then
>> > trash it to install clean and restore apps and files with a prayer that
>> > you did not miss anything?
>>
>> Because you can?  With Windows, I _couldn't_ do that.  With Linux, I can.
>> Install the base system, copy the old /home over it.  Install the
>> packages from /etc/apt/installed.txt (not a stock file - I create that),
>> copy /etc
>> & /var from the old system.  Done.
> 
> Ok this piques my interest. why copy /etc and /var? what if the fresh
> install made changes to some files in those directories that your backups
> of /etc and /var didn't have?

Well, the post was more to say it was possible, than a how-to.  On Windows,
configuration & data is tightly coupled to applications, on Linux it goes
in either /etc or /var (or /home if it applies to a single user).

/var: possibly there's _nothing_ on a new, stock, Ubuntu system you'd need. 
On _my_ system, it's got the mail and news spools, so at the very least I
have to have those.  It also has all my web files - including an apt-move
mirror of all the packages I've downloaded (from _any_ repo, not just
Ubuntu).  So basically, if you're running servers, you probably need /var. 
otoh, you probably _shouldn't_ copy /var/lib/dpkg from the old system.  I'm
not sure there'd be any harm, but there also shouldn't be anything that
won't be recreated by installing all the old packages.  The tricky part
is /var/cache/debconf and, and now that I think of it, that needs to be on
the new system _before_ reinstalling the packages
from /etc/apt/installed.txt (it has all your answers to install prompts). 
I don't think there can be any real harm from overwriting the one from a
fresh install -  you _will_ lose the answers to any new questions on the
packages already installed, but you gain all the answers to unchanged
prompts.

/etc should _also_ be copied before reinstalling packages.  That way, you
get all the prompts from dpkg about needing to overwrite a modified config
file, and you get to make the decisions about what to keep and what to
lose.  Of course, if you've never modified anything in /etc, it's safer to
leave it.

Doing this, there _will_ be situations where applications don't work,
because the old configuration isn't compatible with the new application,
but I'm certain that this is a rarer case - for my style of installation -
than the times that an application from the new install doesn't work
because it doesn't have any of my personal customizations.  Those problems,
though, are why I always do upgrades rather than fresh installs, when
upgrading existing hardware.
-- 
derek





More information about the kubuntu-users mailing list