Thursday, April 23, 2009

Upgrade or Reinstall? How do you move from Intrepid to Jaunty?

Backup and Restore CenterImage via Wikipedia
Jaunty is a day or two away, and a lot of people will be upgrading. There are a bunch of ways to do this:
  1. Download the full CD or DVD and insert it into a running system to upgrade,
  2. Upgrade from the Update Manager,
  3. Wipe and reinstall using the full CD.
  4. Wipe and reinstall using a net install.
Which is best for you really depends on your system. If you have a lot of third-party repositories and/or packages, you run a much higher risk of borking during an upgrade, but you also will need to spend more time getting these back after the reinstall.

My preferred method is to back up my package lists and sources.list, reinstall using a net install, and install the previous packages using the lists I backed up. It works the best for me because I have a fast connection and I don't need to download any packages twice or burn any CDs. To do this:
  • Find a mirror of the netinst.iso installer.
  • Download the linux and inintrd.gz files.
  • Backup your package list to your user directory.
    • Use Synaptic and File > Save Markings, or
    • dpkg --get-selections > packages.txt
  • Copy your /etc/apt/sources.list to your user directory.
  • Backup your data to be safe.
  • Reboot.
  • At Grub, press ESC and enter the command prompt by hitting C.
  • Set your root partition. The command will vary. Most likely ...
    • If you are all in one partition on one disk, type root(hd0,0).
    • If you have a separate /home on the same disk, type root(hd0,1).
    • Other configurationws will vary. Disks start numbering at 0, and partitions do, too.
  • Set your kernel using kernel /path/to/linux. You can use tab completion. This path is the path on your partition, so it may be /home/user/linux or it may be /user/linux depending on whether you have a separate /home or not.
  • Set your initial ram disk using initrd /path/to/initrd.gz. Again, this will depend on your configuration.
  • Boot using the boot command.
  • Follow the easy to use Alternative installer. 
    • Set up the networking.
    • The installer will be downloaded.
    • Set up the system and partition.
    • Install the base system.
    • Choose additional packages using tasksel.
    • Downlaod and install the additional packages.
  • Reboot into your new system
  • Add your third-party repos back in from the backed-up sources.list, changing as necessary.
  • Load the packages.txt file
    • In Synaptic, using File > Read Markings and Apply, or
    • using dpkg --set-selections < packages.txt && sudo apt-get dselect-upgrade.
  •  Enjoy your new system.
For me, this is the safest and easiest method of upgrading your system. If you do it often enough, you can even make a preseed file and automate the whole process.
Reblog this post [with Zemanta]

5 comments:

  1. Hmmm... It's seem that net install method is not for beginners.
    But i will try it because my CD-ROM is now working properly and i can't read home made CD's and i don't have enough space for upgrading.

    So i thought i only have one option, ordering an official CD, but now i have another simple (?) option!

    ReplyDelete
  2. Definitely not for beginners, but not too hard, either.
    Here's the AMD64 directory for the files you need. Just write everything down beforehand, make sure you have DHCP on your network or know all the nameservers, etc., and you should be fine.

    ReplyDelete
  3. I have a simple way to find where is root directory: just run "cat /boot/grub/menu.lst" and find where is the current "linux" file.

    ReplyDelete
  4. And i have another improvement. You can copy "linux" and "initrd.gz" to "/boot" and then edit "/boot/grub/menu.lst" and insert this lines:

    title Ubuntu 9.04, net install
    root (hd2,0)
    kernel /boot/linux
    initrd /boot/initrd.gz

    Save and Reboot.

    ReplyDelete
  5. Thse are fine and probably useful. Since I'm reformatting anyway, I generally just drop the files into my $HOME and use the command line. Whatever works best for you: that's what FOSS is all about!

    Let me know how it works out for you. I hope your connection is fairly fast.

    ReplyDelete

Other I' Been to Ubuntu Stories

Related Posts with Thumbnails