How do I upgrade a Linux distribution?

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

It is a good idea to follow this checklist when upgrading:

- Log in as root.
- Make a copy of the /etc directory to some place where it won’t be distroyed (e.g., zipdrive). This will let me have a look at your previous setup in case I encounter problems.
- Make a backup of any valuable data in the /home directory. This is just in case something went really wrong, for example, if I happened to format a wrong partition.
- Determine and write down the mountpoints on your filesystem using the “diskfree” command:
df
For example, if on the system it shows that the /home my home directory is mounted on a separate hard drive partition called /dev/hda9. and the directory /usr/local is on /dev/hda8. I will write this info on a back of an old envelope.

- Perform the installatation of Linux, but tell the installer to mount the partitions /home and /usr/local at their previous (existing) locations. DO NOT re-format these two partitions. This is critical if you want to preserve your data.
- Boot the new installation and check that it works.
- For each user on the system, create a login with the old name and old user ID number, for example,
ls /home/Shafkat/* -l (check the user ID for account “shafkat” in the file listing of her home directory),
useradd Shafkat -u 503 (create a user acount “shafkat” with with an example uid “503″).
The users will have to select new passwords. If you have lots of users, instead of re-creation of all the accounts you would edit the old and new versions of three files: /etc/passwd, /etc/shadow and /etc/group and copy-paste the relevant user information from the old files to their newer versions (one lines per user in each of the two files, one line per group in the third file).
- From each user home directory, delete the potentialy troublesome setup files, e.g.: “.kde”, “.ICE*”, etc. Good oportunity to delete any junk too. Some setup files may be troublesome because the new version of kde is likely to perform better with the most recent default settings (it will create them on first startup). E.g.,
cd /home/shafkat
rm -fr .kde
- Make sure that each remaining file in the home directories belongs to the appropriate user. For example:

cd /home/shafkat
chown -R shafkat *
chgrp -R shafkat *

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Leave a Comment