How to Upgrade Ubuntu from Ubuntu 16.04 to 18.04 – The latest Ubuntu LTS has been released under Ubuntu 18.04 version and name (Bionic Beaver), released on 26 April 2018, and will be supported for 5 years until April 2023. In this tutorial, I will show you how to upgrade your Ubuntu installation version 16.04 You’re into Ubuntu 18.04 (Bionic Beaver) or later.
- Before starting with the tutorial, make sure you are logged in as a privileged user
- Make sure you are connected to a smooth and fast internet.
- Make sure your Battery is full and there are no power interruptions
Backup Your Data
First and foremost, make sure you back up or backup your data before starting the upgrade of your major operating system. If you are running Ubuntu on a virtual machine it is best to take a full system snapshot so you can easily restore your virtual machine if the update goes awry.
Update currently installed packages
Before starting the upgrade to the latest release, it is recommended to update all the packages you install to their latest versions.
$ sudo apt update
$ sudo apt upgrade
I’m also going to run dist-upgrade which will update the main versions of installed packages and can remove some unnecessary packages:
$ sudo apt dist-upgrade
Upgrade Ubuntu 16.04 to Ubuntu 18.04
Ubuntu provides a tool called
do-release-upgrade which makes upgrading a very easy process. The tool should already be installed on your system but if for some reason it isn’t installed you can install it by typing the following command:
$ sudo apt install do-release-upgrade
To start the upgrade, run
$ sudo do-release-upgrade
If you upgrade your system over SSH like me, you will be asked if you want to continue.
Output Reading cache Checking package manager Continue running under SSH? This session appears to be running under ssh. It is not recommended to perform an upgrade over ssh currently because in case of failure it is harder to recover. If you continue, an additional ssh daemon will be started at port '1022'. Do you want to continue? Continue [yN]
Output Starting additional sshd To make recovery in case of failure easier, an additional sshd will be started on port '1022'. If anything goes wrong with the running ssh you can still connect to the additional one. If you run a firewall, you may need to temporarily open this port. As this is potentially dangerous it's not done automatically. You can open the port with e.g.: 'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT' To continue please press [ENTER]
After the Upgrade Tool downloads the package list and calculates the changes, it will ask you if you want to continue.
Output Do you want to start the upgrade? 4 installed packages are no longer supported by Canonical. You can still get support from the community. 3 packages are going to be removed. 90 new packages are going to be installed. 397 packages are going to be upgraded. You have to download a total of 267 M. This download will take about 1 minute with your connection. Installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled.
Once again type
y and the upgrade process will begin.
During the upgrade process, you will be asked various questions, such as whether you want to save the existing configuration file or install the Package Maintainer version. If you don’t make any special changes to the file, then you can safely type
Y if not, so that the configuration matches the current one, please type it
Output Configuration file '/etc/sysctl.conf' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** sysctl.conf (Y/I/N/O/D/Z) [default=N] ?
The upgrade process may take some time depending on the number of updates and your Internet speed.
After the new package is installed, the update tool will ask you if you want to remove outdated software, if you are unsure of type
d and check out old package lists, in most cases it’s safe to include
y and remove all old packages:
Output Searching for obsolete software Reading package lists... Done Building dependency tree Reading state information... Done Reading state information... Done Remove obsolete packages? 17 packages are going to be removed.
After the upgrade process is complete and assuming all goes well, you will be prompted to reboot your computer. Type
y to continue:
Output System upgrade is complete. Restart required To finish the upgrade, a restart is required. If you select 'y' the system will be restarted. Continue [yN] y
Wait a few moments for your server to reboot and then reconnect. After logging in, you will be greeted with the following message:
Output Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-20-generic x86_64)
You can also check the Ubuntu version by using the following command:
$ lsb_release -a
Output No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04 LTS Release: 18.04 Codename: bionic
That’s all, you can now enjoy your new Ubuntu 18.04 LTS (Bionic Beaver). And the upgrade process from Ubuntu 16.04 to 18.04 is complete.
And that’s the complete guide on how to upgrade ubuntu version 16.04 to the latest version 18.04 LTS Bionic Beaver. Hopefully this article was useful for you, good luck :).