You are hereUbuntu Tips / Updating and upgrading Ubuntu (from the terminal)

Updating and upgrading Ubuntu (from the terminal)


By charm - Posted on 29 November 2009

No votes yet

Introduction

Often when Ubuntu Linux is freshly installed on a machine there are hundreds of updates available. Even on a fast machine with a fast connection installing hundreds of updates can take quite a bit of time. Ubuntu's graphical update manager provides an easy way of updating Ubuntu, but it's not the most efficient method. Updating from the terminal (command line) is much quicker, less resource demanding, and just as easy to do.

Steps

Updating Ubuntu from the command line/terminal is just a few simple steps:

  1. Click Applications then Accessories then Terminal.
  2. In the terminal window type sudo apt-get update. When the update finishes type sudo apt-get upgrade.

Tip: You can use the up arrow key after typing sudo apt-get update (and pressing enter) to repeat the command and erase the date part of update and replace it with grade for upgrade.

These steps update the packages in the current version of Ubuntu. But what about those pesky applications that say they're being held back??? To upgrade those just type: sudo apt-get dist-upgrade

But isn't dist-upgrade used to upgrade from one version of Ubuntu to the next? Yes, it is, but only if you change the /etc/apt/sources.list file to show a different flavour of Ubuntu. (for example: if /etc/apt/sources.list says jaunty throughout, you would need to change jaunty to karmic in order to upgrade from one flavour of Ubuntu to the next).

So what do the two commands do?

sudo apt-get update updates the list of what software is available with the most recent updated software from the sources in your /etc/apt/sources.list file. The /etc/apt/sources.list file contains all the sources for software. In English it simply means that file points Ubuntu to places where it can download updates and software. sudo apt-get upgrade calculates if the software requires other software in order to install (called dependencies) and installs the software.

End result

The end result is that you end up with an updated system rather quickly. As mentioned earlier, Ubuntu's update manager might seem easy, but when you have a lot of updates it's sometimes easier and faster to use the terminal.

End Result: 

Navigation

Syndicate

Syndicate content

Open Source Links

Ubuntu Linux web site

Recommended Books