11

The machine has no desktop, only a command shell. It is running 12.04. I have been doing apt-get update & upgrade weekly for four years. How do I convert it to 16.04 from the command line? I have a 16.04 server install CD, do I boot from that?

user545217
  • 151
  • 1
  • 2
  • 9
  • What have you followed that didn't work? Did you tried http://askubuntu.com/q/110477/169736? – Braiam May 29 '16 at 23:54

2 Answers2

17

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
dchest
  • 107
dufte
  • 13,272
  • 5
  • 39
  • 43
0

As far as I can tell, I must edit /etc/update-manager/release-upgrades to change Prompt to [DEFAULT] Prompt=lts

Then reboot and give these commands:

sudo bash
apt-get update
apt-get upgrade

{Reboot again}

sudo bash
do-release-upgrade -c

{check target version}

do-release-upgrade

{I can upgrade from 12.04 to 14.04 now; upgrading from 14.04 to 16.04 may have to wait until August}

=========

I asked a question about how to upgrade a server from 12.04 to 16.04. I got many leads, links to other sites, etc. Finally, I posted my own answer - the specific commands I must give to do it. My posted answer was gleaned from reading all the other answers.

Every answer has a rating. I assume higher numbers are better. I see that my summary answer has a rating of minus one. I assume this is worse than zero. How did I earn a minus one rating?

Note: all three of my computers already read "Prompt=lts"

user545217
  • 151
  • 1
  • 2
  • 9