How to upgrade from 14.04 LTS or 15.10 to 16.04 from terminal [duplicate]

The easiest way is sudo do-release-upgrade.


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