In the following lines we are going to take a look at how can we upgrade from Ubuntu 18.04 to Ubuntu 19.04 directly from terminal. In an article a few days ago, a colleague explained to us how to upgrade Ubuntu 18.04 and Ubuntu 18.10 to Ubuntu 19.04. However, because Ubuntu 18.10 is still supported, version 18.04 users must first update to version 18.10 and follow the same process to update to 19.04.
Something that I think you have to remember is that Ubuntu 19.04 Disco Dingo it is a normal launch. This means that it is one of those versions that have support for 9 months. In my opinion, users who use Ubuntu for day-to-day work should possibly stick to the LTS version, but that's a matter of taste. For this example I am going to use an Ubuntu 18.04 virtual machine, since I have always preferred to move between LTS versions on my work teams.
As the colleague indicated in his article on how upgrade to Ubuntu 19.04If Ubuntu 18.04 users follow the standard upgrade procedure, they will be prompted to upgrade to version 18.10 first. This is due to the fact that Ubuntu 18.10 has not yet reached the end of its useful life. After Ubuntu 18.10 reaches the end of its useful life in July 2019, Ubuntu 18.04 users will be able to upgrade directly to 19.04, following the standard upgrade procedure..
With that said, next we will see how we can upgrade from Ubuntu 18.04 directly to Ubuntu 19.04 from the command line, bypassing Ubuntu 18.10. If you don't want to wait 3 months or don't have time to update twice, you can follow the instructions below.
Table of Contents
How to upgrade from Ubuntu 18.04 to Ubuntu 19.04 directly from terminal
In the following lines we are going to change the update path that Canonical gives us by default. The Ubuntu version that I am using for this example is:
First, run the following command to upgrade existing software. It's important to put attention on if a new kernel is installed while running this command, you must reboot to continue with the update process. In a terminal (Ctrl + Alt + T) we write:
sudo apt update && sudo apt upgrade
We continue to ensure that we have the update-manager-core package installed typing in the same terminal:
sudo apt install update-manager-core
The next thing we will do is edit configuration file using your preferred command line text editor:
sudo vi /etc/update-manager/release-upgrades
At the bottom of this file, change the request value from "lts" to "normal".
By the end, save the file and exit the editor of text.
Disable third-party sources
Then we must execute the following command to change all instances of bionic to disk in archive / Etc / apt / sources.list. Bionic is the name for Ubuntu 18.04, while disco is the name for Ubuntu 19.04.
sudo sed -i 's/bionic/disco/g' /etc/apt/sources.list
If you have added third party repositories in the file / Etc / apt / sources.list and in the directory /etc/apt/sources.list.d/, disable all third-party repositories. You will be able to do this by commenting on each line in the file, adding the # symbol at the beginning. When done, save the file.
After disabling the third-party repositories, run the following commands to update software sources. We will also update the software to the latest version available in the Ubuntu 19.04 repository. This step is known as a minimal update:
sudo apt update sudo apt upgrade
After the minimal update finishes, run the following command to start full update:
sudo apt dist-upgrade
Now you can remove obsolete / unnecessary software packages from your Ubuntu system:
sudo apt autoremove && sudo apt clean
In conclusion, reboot the system:
sudo reboot now
Once rebooted, you can open the terminal window and check your Ubuntu version with the command:
You should see something like the following:
And with this we will have updated Ubuntu 18.04 directly to Ubuntu 19.04 no need to update twice or wait for Ubuntu 18.10 to be discontinued.