How to upgrade a server from 12.04 to 16.04?

Solution 1:

General

You can always upgrade from LTS to LTS, in your case that would mean:

  • upgrade from 12.04 to 14.04 and then
  • upgrade from 14.04 to 16.04

As far as i know there is no supported upgrade from 12.04 to 16.04 directly.

Following this approach there is no need for your 16.04 medium

As always, consider creating a backup of your critical files before you start.

Limit to LTS

The way to limit upgrades to LTS without a GUI is to change the value of  Prompt in /etc/update-manager/release-upgrades.

Set it to

[DEFAULT] Prompt=lts

The possible values are

  • 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

How to upgrade

For both upgrade processes you should always update the current system via

sudo apt-get update
sudo apt-get upgrade

Then start the upgrade via

sudo do-release-upgrade

or - SPECIAL CASE - for development versions (which is valid for upgrades from 14.04 to 16.04 until 16.04.1 was released):

sudo do-release-upgrade -d

If do-release-upgrade command is not found, install it:

sudo apt-get install update-manager-core