Can I install Debian (or Red Hat) over an existing Watchtower installation?

(Thanks to Michael Schmitz for pointing me in the right direction for answering this question)

You can; however, I strongly recommend against doing so. There are various reasons: two of the most important are varying file locations and C library conflicts. I speak from experience that you don't want to mix files (I'm still cleaning up old a.out and libc5 files from my system).

Here's a procedure that should work well for doing an installation from scratch, while keeping your old user files available. This is not well-tested or anything, but should help you get the idea of what you need to do:

  1. Print out your /etc/passwd and /etc/group files (you may need them later). You should also print out your network configuration information.

  2. Back up your Linux partitions; if you are installing on a clean disk (i.e. not the one you're using now), you can forgo this and the next two steps.

  3. If you have a home partition with all of your user directories on it, keep it around. Otherwise, make a tar file of your home directories tree and copy that somewhere safe (a non-Linux partition should be fine); make sure you use the "-p" flag with tar to retain all of the permissions.

  4. Repartition (if you want). But don't clobber home if you already had one.

  5. Install the base distribution (Debian, Red Hat, whatever) and any packages you want extra.

  6. Add the actual user accounts from your old /etc/passwd file to your new system, using your distribution's user adding utility (for Debian, it's useradd). Set the passwords to each account (or disable them). If you had any special groups (besides a users or staff group), you may want to add them as well.

  7. Mount your home tree at /home (if it was on a partition). If you have a tar file of the home tree, figure out where you're going to put it (/var/home might be a good choice, although a separate partition would be preferable), untar the home tree there (again using the "-p" flag), and make a symlink (if necessary) from /home to the root of your new home tree.

  8. If you didn't use the tar file: cd to /home and change the ownership of the users' files to their new users. For example, for a user named bob (in a group named users), chmod -R bob.users /home/bob. If people have interspersed files, you may need to do a find operation to get the permissions straight (refer to your old password and group files if necessary).

This outline should at least point you in the right direction; let me know if you have any suggestions for improving these instructions.