upgrade ubuntu to the latest lts version through command line - zhouyoujoin/ubuntu GitHub Wiki

step1, upgrade current system with 'apt'

sudo apt-get update
sudo apt-get upgrade 
sudo apt-get dist-upgrade

step2, install 'update-manager-core'

sudo apt-get install update-manager-core

step3, make 'prompt = lts' in file "/etc/update-manager/release-upgrades", this ensure the version which will be upgraded to is the long term service version.

step4, start upgrading, after this, you can use 'lsb_release -a' command for checking.

sudo do-release-upgrade