To upgrade Ubuntu to the latest version using the command line, follow these steps:

1. Install the package update-manager-core

# apt-get install update-manager-core

2. Execute do-release-upgrade

# do-release-upgrade

NOTES:

– If the upgrade is performed remotely from a ssh shell, it’s highly recommended to run the upgrade from within a screen session; that way you can resume the upgrade if ssh connection breaks

– If ‘do-release-upgrade’ returns ‘No new release found’ when you know there’s one, that’s probably because you’re trying to upgrade from a LTS (Long Term Support) Ubuntu version to a non-LTS one; to fix this:

  1. edit the file ‘etc/update-manager/release-upgrades’ and set the variable ‘Prompt’ to ‘normal’
  2. rerun ‘do-release-upgrade’