Tutorial: Upgrading to Ubuntu 18.04 from Ubuntu 16.04

Upgrade to Ubuntu 18.04 logo
The Ubuntu’s latest Long Term Support (LTS) release, Ubuntu 18.04 - Bionic Beaver, was released on April 26, 2018. If you’re running Ubuntu 16.04 LTS - Xenial Xerus, you may want to upgrade to the latest release to test the new features. The process of upgrading from Ubuntu 16.04 to Ubuntu 18.04 is relatively straightforward and should take no more than 30 minutes if you have a good internet connection.

Prerequisites

  • You have an Ubuntu 16.04 system with access to a sudo enabled user.
You should keep the following things in mind while you do release upgrade of Ubuntu 16.04 to Ubuntu 18.04.
  • Backup all critical data from the system to a remote location using a utility program like rsync. Even better, take a complete snapshot of your system.
  • Make sure the SSH connection does not drop while the upgrade process is running. You can use a small utility program called screen to prevent the session from “timing out” or disconnecting. If there is any SSH connectivity failure during the upgrade process, you can reconnect to the session using screen.
  • Don’t run the upgrade procedures in a production system. If you are keen to upgrade in a production system, first test all your software and apps against the upgrade in a staging environment.

Step 1. Update the installed packages

Before you begin the release upgrade process, update all your existing packages to the latest versions. Issue the following command to check the current release version of your system:
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
Update the list of available packages and their versions with the following command:
$ sudo apt-get update
Now, install the newer versions of these packages:
$ sudo apt-get upgrade
After upgrading the packages, check the Ubuntu’s release number. You will find that your distribution of Ubuntu 16.04 is upgraded. In our case, it upgraded to Ubuntu 16.04.4 LTS.
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
The primary purpose of upgrading packages to the latest release is to keep the difference between your installed packages and the new ones in Ubuntu 18.04 as small as possible. Smaller differences minimize the risk of potential errors during the process.

Step 2. Upgrade Ubuntu

The official recommended upgrade procedure uses a tool called do-release-upgrade. This tool is a part of update-manager-core package and is installed by default. If for some reason.... Read More