How to upgrade to Ubuntu 20.04 LTS
Learn how to upgrade your server to Ubuntu 20.04 LTS from previous versions.
This blog is hosted in a dedicated server from Kimsufi and managed through Laravel Forge, but I had some problems trying to install it.
To be able to install Laravel Forge to the server, an Ubuntu 20.04 LTS image is needed. The problem I had is that Kimsufi only offers an Ubuntu 16.04 image. In this post I will show you how to update from Ubuntu 16.04 to Ubuntu 20.04 LTS.
What does LTS mean?
LTS is the acronym of Long Term Service. This means that this kind of versions will be updated longer than a normal one. In Ubuntu, LTS versions will receive support for 5 years, while the rest of versions will only have 9 months. You can learn more here.
Note: As we can only upgrade to Ubuntu 20.04 LTS from Ubuntu 18.04 LTS, we must first upgrade to this version before Ubuntu 20.04. Please note that in this tutorial will be updating from version 16.04.
Update dependencies
Once you have logged into the server, we must update the server dependencies.
We can do it through this command:
sudo apt update && sudo apt upgrade
Check which version the server can be upgraded to
Once the dependencies have been updated at the server, we need to check which version the server can be upgraded to, because we will upgrade only to LTS versions. This can be checked with this command:
sudo cat /etc/update-manager/release-upgrades
Prompt must have LTS as value to be able to upgrade to only LTS versions. Check out the screenshot to see how it should look.
Restarting the server
We are going to reboot our server through this command:
sudo reboot
Once we have rebooted, we log in again.
Install the update tool
We can install the Ubuntu update tool through this command:
sudo apt install update-manager-core
Updating
With this command we will start updating the server:
sudo do-release-upgrade
You must follow the steps of the update from the terminal while the updating process lasts.
Keep in mind that the process can take several minutes and even hours.
We will finish the update by restarting the server.
Checking the server version
Once logged in after updating, we can check the server version with the following command:
sudo lsb_release -a
We will know if it's okay if we see 18.04.5 LTS version in screen (taking into account that we have started from 16.04 version)
Make Ubuntu release upgrade to 20.04 LTS
We update the server again with the command below:
sudo do-release-upgrade -d
Again, keep in mind that the process can take several minutes or even hours.
Checking the Ubuntu upgrade
Once you have finished the upgrade, and you have restarted, we will have to check, again, in which version our server is. If we have done well, we will see the 20.04 LTS Focal Fossa version!
Congratulations ?! The server is now ready to be used in its new version!