ubuntu - tips & tricks

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 ( Ctrl + Alt + T ). 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.

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.

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

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

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

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 threenine.co.uk
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.

Affiliate Disclaimer

Disclosure: Please note that some of the links included in the blog posts are affiliate links, which means I will earn a commission if you decide to make a purchase.

I only include affiliate links to products, services and companies that I have personal experience and have actually used. I only recommend them because they are helpful and useful, not because of the small commissions I make if you decide to buy something.

Please do not spend any money on these products unless you feel they are relevant, suitable and will help you achieve your goals.

Buying anyone of these products and the commisions earned will not make me an overnite multi millionaire, but they will help to cover the hosting costs and compensate for the countless hours and effort I put in to create meaningful and valuable free content I provide to help others succeed.

You've also undoubtedly noticed that I also use various advertising networks - unless of of course you're using an Ad blocker, this is also an attempt to reduce my monthly deficit I experience in providing free relevant, valuable and on occassion insightful content for the benefit of others.

I only really make some money if people click on the ads, unless of course you consider 1c per 1000 impressions real money!

Bear in mind just how many impressions I need to make before I can cover my £20 hosting costs a month!

If you are using an adblocker and guilt stricken you can of course donate using any of the buttons below, but I won't be holding my breath.

Buy me a coffeeBuy me a coffee