How to upgrade Ubuntu using command line

A new release of Ubuntu operating system has been released, Ubuntu 14.04 codenamed Trusty Tahr. This is the 5th Long Term Support (LTS) for Desktop, Server, Cloud, and Core, as well as Ubuntu 14.04 for Phone and Tablet products. Ubuntu 14.04 LTS continues Ubuntu’s proud tradition of integrating the latest and greatest open source technologies into a high-quality, easy-to-use Linux distribution.

Although the Ubuntu team have made a great job of making the update process for the distribution really user friendly with a nice graphical user interface, one of the most Frequently Asked Questions (FAQ) on the Ubuntu or linux forums asked by majority of linux newcomers or even ubuntu intermediate users is: How To upgrade ubuntu using command line.

To open your Terminal Window, click on your ubuntu icon and type in terminal in the text box provided


Or just use your keyboard short cut ( [key]Ctrl[/key] + [key]Alt[/key] + [key]T[/key] ). This will open up a command line like window, with which you can perform linux administrative tasks.

We’ll be making use of the APT package handling Utility to preform these updates. The apt-get is the command-line tool for handling packages, and may be considered the user’s “back-end” to other tools using the APT library.


The first command I advise you to run using apt-get, will give you access to the all important manual. This will provide you with all the important details about the commands we will be running. Using your terminal window type in the following and hit Enter.

man apt-get

Have a quick read through this manual just to get acquainted with the commands, you will find that they will come in very handy the more you get familiar with linux. We will provide some text from manual below the commands to help you understand what you are doing.

How To upgrade ubuntu distribution using command line.

1. Always preform some updates to your current release.

sudo apt-get update

update is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in/ etc/apt/sources.list. An update should always be performed before an upgrade or dist-upgrade.

2. Install the newest packages

sudo apt-get upgrade

upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at
their current version. An update must be performed first so that apt-get knows that new versions of packages are available.

3. Upgrade your distribution packages

sudo apt-get dist-upgrade

dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.

4. Preform the upgrade

sudo do-release-upgrade

do-release-upgrade upgrades operating system to latest release command-line. This is the preferred command if the machine has no graphic environment or if the machine is to be upgraded over a remote connection.

There may be some additional screen prompts for input. but generally these are only confirmations that you want to carry out the actions.

As an additional precaution I always prefer runs steps 1,2,3 after the install has completed and I have restarted the machine.

Gary Woodfine

Freelance Full Stack Developer at
Helps businesses by improving their technical proficiencies and eliminating waste from the software development pipelines.

A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.

Latest posts by Gary Woodfine (see all)