Wednesday, January 7, 2009

Upgrading your Ubuntu using the Command Line

With the pace at which most major Linux distributions are releasing new versions these days, it's sometimes hard to stay up to date with the latest and greatest in your flavor of choice. Recently I upgraded my Ubuntu from Breezy Badger to Intrepid Ibex using the command line.

Here are some step by step instructions to take you through the process.


  1. The first step is to get your current system up to date.

    sudo apt-get update
    sudo apt-get dist-upgrade

    You may need to reboot after this step if the kernel was upgraded or patched.



  2. Now you need to reconfigure APT to point to the release you want to upgrade to. This is accomplished by editing your /etc/apt/sources.list file.


    1. First create a backup of your old sources list.


      sudo cp /etc/apt/sources.list /etc/apt/sources.list.breezy




    2. Now grab your favorite editor (as long as it's VI). You have to re-point all of your sources to those of the new release.

      sudo vi /etc/apt/sources.list

      Do a search and replace from breezy to intrepid (make sure you're in command mode by first pressing esc).

      :%s/breezy/intrepid/g

      Save the file and exit VI.

      :wq
      or ZZ



  3. Now all that's left is to update your system using apt-get.

    sudo apt-get update
    sudo apt-get dist-upgrade


Once you're all done, reboot your system.

Congratulations, you have just upgraded your Ubuntu in a matter of minutes, using only the command line.

No comments:

Post a Comment