• RESUME
  • LOGIN

balanced scale media

  • blog
  • projects
  • services
  • contact
Home › Blogs › boz's blog

An Ubuntu Upgrade Guide

boz — Tue, 10/27/2009 - 10:09

I've found the cleanest way to upgrade Ubuntu is to do a fresh install.  Here is a list of steps that I take to upgrade.

  1. Backup Your Installed Applications
    Unfortunately, Ubuntu does not provide a tool to backup/restore your currently installed applications.  However, there is a way!  Using dpkg you can dump a list of your installed packages into a text file, which you can used later to reinstall them.  I found this method in the Ubuntu forums, but will repost it here from convenience.

    To dump a list of your installed packages into a text file run this.

    dpkg --get-selections > installed-software

    Make sure to store this file in your user directory for the next step.

  2. Backup Server Configuration (optional)
    If you don't use Apache or MySQL you can skip steps 3, 4, 8, and 9.

    Backup your /etc/apache2 folder.

    sudo tar cfzv apache_backup.tar.gz etc/apache2/
    sudo mv apache_backup.tar.gz /home/username

     

  3. Backup MySQL Databases (optional)
    Dump your databases to a text file.

    mysqldump --all-databases -uroot -p > mysql.backup.sql
    sudo mv mysql.backup.sql /home/username

     

  4. Backup your user directory
    It's best practice to keep all of your files in your user directory (/home/<username>/), so hopefully you won't need to to worry about much outside of this.  I've used both SBackup and Rsync for backup.  Both are available via Synaptic or apt-get.  I prefer Rsync and highly recommend install the gui package Grsync, which is also available via Synaptic or apt-get.  I backup to an external hard drive.  If you have large files, i.e. larger than 4GB, make sure your external hard drive uses a file system that supports large file transfers.  I had to reformat my external drive because it was formatted fat32, which only supports 4GB file transfers.

    You can install grsync like this.
    sudo apt-get install grsync 

     

  5. Install Ubuntu!
    Download the latest and greatest Ubuntu image from www.ubuntu.com.  Burn the images to CD or to a thumbdrive and follow the installation instructions.
     
  6. Merge the backup of your user directory into your new user directory
    You don't want to copy everything from your previous user directory to the new user directory just yet.  Ubuntu applications store configuration settings in your user directory, usually in directories that start with ".".  You can copy everything and risk it, but I prefer to just copy my personal files first and restore application configuration directories as needed.  You may not need the old ones at all!
  7. Reinstall your application packages
    First, select the packages to install from the text file we created in step 1.

    dpkg --set-selections < installed-software

    Now, we need to install them.

    dselect

    This may take some time.

  8. Restore your apache configuration (optional)
    Copy your apache backup to your new user folder and extract it.  Then overwrite your existing apache config directory with your backup.

    sudo cp -f -r apache2 /etc/apache2

     

  9. Restore MySQL Databases (optional)
    Restore the databases from the dump file that we created in

    mysql --verbose --user=XXXXXXXX --password=XXXXXXXX DB_NAME < /PATH/TO/DUMPFILE.SQL

Finished! 

 

  • Linux
  • Ubuntu
  • boz's blog
  • Add new comment
  • ""

Recent Posts

  • Remote Drush
  • Update CCK Fields In Custom Drupal Nodes
  • Image Security Made Simple With jQuery
  • Simple Apache / MySql Backup Script
  • Environment Based Database Selection In Drupal
  • Comparing Syntax of MooTools 1.1 with MooTools 1.2 and jQuery 1.4
  • Nid Based Panel Variants in Drupal
  • Security Updates for 2010
  • Contribution to Sandy's Ankeny
  • Access localhost from a VirtualBox Guest OS on Ubuntu
more

Topics

  • Apace
  • Aptana
  • Bazaar
  • Code
  • Drupal
  • Eclipse
  • Flex
  • JavaScript
  • jQuery
  • Linux

Archive

  • February 2008 (1)
  • May 2008 (1)
  • July 2008 (3)
  • December 2008 (2)
  • January 2009 (2)
  • March 2009 (3)
  • April 2009 (5)
  • May 2009 (1)
  • July 2009 (1)
  • August 2009 (3)
more

Links

Firefox 3

drupal

ubuntu

 

  • blog
  • projects
  • services
  • contact

© 2010 Balanced Scale Media, LLC. All Rights Reserved.