Upgrade Ubuntu 18.04 LTS or 19.10 To Ubuntu 20.04 LTS From Command Line



Before getting started, we suggest you Learn Linux Basics and follow these precautions.

Updated: 2020-04-23
Created: 2020-04-17

This HowTo outlines the commands to upgrade both Desktop and Server editions of Ubuntu 18.04 LTS (Bionic Beaver) or Ubuntu 19.10 (Eoan Ermine) to Ubuntu 20.04 LTS (Focal Fossa) from a terminal.

According to the Ubuntu Release Cycle, LTS or "Long Term Support" releases are published every two years in April. LTS releases are the "enterprise grade" releases of Ubuntu and are utilised the most. An estimated 95% of all Ubuntu installations are LTS releases.

Every six months between LTS versions, Canonical publishes an interim release of Ubuntu, with 19.10 being the latest example. These are production-quality releases and are supported for 9 months, with sufficient time provided for users to update, but these releases do not receive the long-term commitment of LTS releases.

  • Ubuntu 18.04 LTS released April 26, 2018 and is supported for 5 years until April 2023.
  • Ubuntu 19.10 (interim) released October 17, 2019 and is supported for 9 months until July 2020.
  • Ubuntu 20.04 LTS released on April 23, 2020 and is supported for 5 years until April 2025.

Upgrading prior to the official release on April 23, 2020 may result in a Beta or Release Candidate installation. We strongly suggest you check Ubuntu.com for the current release status.

These steps can be preformed as an in place upgrade on a live system from either a local terminal or remote SSH session.

Step 1

Prior to upgrading, make sure the current system is up-to-date.

sudo apt update && sudo apt dist-upgrade

Step 2

Confirm the update-manager-core package is installed.

sudo apt install update-manager-core

Step 3

If you are currently running 18.04 LTS you may skip this step, 19.10 will require this change.

Use vi text editor (or your favorite editor) to modify the default Upgrade Policy.

sudo vi /etc/update-manager/release-upgrades

Towards the bottom of this file, change Prompt=normal to Prompt=lts and save. It should look like this.

# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
#  never  - Never check for a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the release that immediately succeeds the currently-running
#           release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that this option should not be
#           used if the currently-running release is not itself an LTS
#           release, since in that case the upgrader won't be able to
#           determine if a newer release is available.
Prompt=lts

Step 4

Upgrade to the latest release with this command, then follow the on-screen instructions and reboot when prompted.

sudo do-release-upgrade

If this command returns the following notification message, this means you tried to upgrade prior to the official release or the "soaking period" is still in effect.

Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS develoment release
set Prompt=normal in /etc/update-manager/release-upgrades.

The soaking period for 19.10 will be a few days and 18.04 LTS will be a few months after official release of 20.04 LTS. We can bypass this by adding the -d option to our command, then follow the on-screen instructions and reboot when prompted.

sudo do-release-upgrade -d

Step 5

Verify your release has been upgraded.

lsb_release  -a

Output will be similar to this.

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

Step 6

Clear out the local repository of retrieved package files and dependencies that are no longer required.

sudo apt clean

sudo apt autoremove