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


3 Answers 3


The easiest way is sudo do-release-upgrade.

  • 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. Jun 7, 2016 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 help.ubuntu.com/lts/serverguide/installing-upgrading.html.
    – edwinksl
    Jun 7, 2016 at 18:59
  • -d is only for development releases as said there, and not recommended for production envs, thx for the link :) Jul 1, 2017 at 1:55

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
  • To upgrade on 16.04 from 14: sed -i -e "s/trusty/xenial/g" /etc/apt/sources.list Jul 24, 2019 at 12:25

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


Not the answer you're looking for? Browse other questions tagged or ask your own question.