12

How to upgrade from 14.04 LTS or 15.10 to 16.04 from terminal.

Vitor Abella
  • 7,537

3 Answers3

17

The easiest way is sudo do-release-upgrade.

edwinksl
  • 23,789
  • 4
    This is not sufficient! You have to first choose Software & Updates > Updates > Notify me of a new Ubuntu version > For any new version. Now, do sudo apt-get update, sudo apt-get upgrade and finally sudo do-release-upgrade. If you just have there For long-term support versions, it will not work because you cannot upgrade for some reason directly from LTS to LTS at the moment. – Léo Léopold Hertz 준영 Jun 07 '16 at 17:29
  • 1
    @Masi You raised a good point. If you are using a LTS, you can only upgrade to the first point release of the next LTS. If you want to upgrade before the first point release without using the GUI, as is the case currently if you want to upgrade from 14.04 LTS to 16.04 LTS, use the -d flag as mentioned in https://help.ubuntu.com/lts/serverguide/installing-upgrading.html. – edwinksl Jun 07 '16 at 18:59
  • -d is only for development releases as said there, and not recommended for production envs, thx for the link :) – Aquarius Power Jul 01 '17 at 01:55
8

You can use sed for editing your sources.list file. I suggest you to backup it first.

To upgrade on 15.10:

sed -i -e "s/trusty/wily/g" /etc/apt/sources.list
apt-get update && apt-get dist-upgrade

To upgrade on 16.04:

sed -i -e "s/wily/xenial/g" /etc/apt/sources.list
apt-get update && apt-get dist-upgrade
monitor35
  • 537
  • 1
  • 4
  • 8
3

Try this first do:

sudo nano /etc/apt/sources.list

then change everything with trusty in it to either xenial (for 16.04) or wily (for 15.10)

then do:

apt-get update;apt-get upgrade -y

and then there you go, you have a fully upgraded 15.10/16.04 system, you do need to run

apt-get autoremove --purge -y;apt-get clean

afterwards

patrick
  • 513