Recently my OS X 10.2.8 began malfunctioning (all Carbon and Classic apps would not launch). After exhausting attempts to fix it, I got out the install disks and re-installed my system. It's not a perfectly simple process, but I have some hints on how to do this and not lose (much) of your exisiting configuration, and do it all without having copy stuff to another computer (of course, it would be smart to have a backup made before doing anything like this).
[robg adds: With the newly-announced Panther ship date (what, you haven't visited apple.com yet today?), this information may be particularly useful in the near future for upgrades, not just corruption recovery. Read the rest of the articles for the details, and feel free to comment with the tips and tricks that you use when upgrading a machine...]
Get the software you need.
The Re-install.
Actually now we get to the tricky part. Your old configuration has now been saved in a top level folder called "Previous Systems" and inside this you should see "Previous System 1" (assuming this is the first time you did this). This contains some things you need to keep by dragging them back to their original locations, then you can delete the rest. I can only give you some guidelines here, as I don't know what special things you may have installed.
As a safety precaution, delete any soft links in the /Previous Systems -> Previous Systems 1 directory (e.g. the private directory is one). This will keep you from making some easy mistakes when the time comes to delete files. At first I tried using a recursive diff, like this,
diff -r --brief /Library /Previous\ Systems/Previous\ System\ 1/Library/
to view the differences (you may wish to run this as sudo). However, this produces a tedious amount of information -- somewhat useful for getting the big picture, but too much to find those key files. Instead, what I did was to write a little perl script to delete any files that appear to be identical to the current ones:
cat > compare.pl
#!/usr/bin/perl -wn
# note the -wn above!
chomp;
next unless -f; # skip if not a file
$y = quotemeta($_); #meta quote the spaces
# Note the following assumes the name of the
# Previous System is in fact numbered 1
$x = '/Previous\ Systems/Previous\ System\ 1/';
$z = '/Previous Systems/Previous System 1/';
# the difference between these lines arises
# from the different ways perl and the system
# parse meta characters in file system commands.
$g = $z.$_; # path to prev system file in perl syntax
if (-f $g) { # skip unless this file exists
# compare md5 checksums of old and new files
$k= `/sbin/md5 $x$y`; # path to prev system file in unix syntax
$j= `/sbin/md5 $y`;
@k1 = split /=/, $k; # get the part after the "=" sign
$kk = $k1[-1];
chomp($kk);
@k1 = split /=/, $j;
$jj = $k1[-1];
chomp($jj);
if ($kk eq $jj ) {print `rm $x$y`};
}
To use this, I select a folder like the Library and run sudo find /Library | sudo ./compare.pl. Warning: executing that line of code will delete files on your computer and cannot be undone. It does what you want but just be aware of this.
After doing this I was able to get all of my applications running again except for Keynote, which I could never figure out what library files were inconsistent.
Personally, taking advantage of this fresh start, I decided to scap my old usr -> local folder and re-install any custom unix packages. The reason was that I had lots of things that were obsolete and did not want too keep, but found it too hard to reliably unistall from the man pages and so forth.
After completing this, I found that I had freed up gigabytes of disk space that had been chewed up by logs, and obsolete data from various applications I no longer used. Also, my computer booted a lot faster than it used to -- not sure why, but no doubt my system had more cruft than I realized.
References: Useful sources of information:
Mac OS X Hints
http://hints.macworld.com/article.php?story=2003100317550644