In a previous article, I explained how to upgrade Ubuntu 18.04 and Ubuntu 18.10 to Ubuntu 19.04. However, because Ubuntu 18.10 is stilled supported by the Canonical company, Ubuntu 18.04 users need to upgrade to 18.10 first and follow the same process to upgrade to 19.04. This tutorial will be showing you how to upgrade Ubuntu 18.04 directly to Ubuntu 19.04 from command line, bypassing Ubuntu 18.10.

Why Ubuntu 18.04 Needs to Upgrade to 18.10 First?

As explained in the previous article, if Ubuntu 18.04 users follow the standard upgrade procedure, they will be told to upgrade to 18.10 first.

This is due to the fact that Ubuntu 18.10 is still being supported by Canonical and hasn’t reached end-of-life yet. After Ubuntu 18.10 reaches end-of-life in July 2019, Ubuntu 18.04 users can upgrade to 19.04 directly, following the standard upgrade procedure. If you don’t want to wait 3 months and don’t like upgrading twice, you can follow the instructions below to upgrade to 19.04 directly.

Note:  Before doing the upgrade, you can use the systemback program to create a bootable ISO image from your current OS. If the upgrade fails, you can easily restore your OS with the bootable ISO. Everything on your OS including software and files will be intact.  If you are using a laptop, please connect your power source.

Upgrade Ubuntu 18.04 to Ubuntu 19.04 Directly From Command Line

The method I’m going to show you is how the Ubuntu distribution upgrade manager works under the hood. The only difference is that we are going to change to upgrade path that Canonical gives us.

First, run the following command to upgrade existing software. (Please note that if a new kernel is installed while running the following command, you need to reboot system in order to continue the upgrade process.)

sudo apt update && sudo apt dist-upgrade

Then make sure you have update-manager-core package installed.

sudo apt install update-manager-core

Next, edit a configuration file using nano or your preferred command line text editor.

sudo nano /etc/update-manager/release-upgrades

At the bottom of this file, change the value of Prompt from lts to normal.

Prompt=normal

To save a file in Nano text editor, press Ctrl O, then press Enter to confirm. To exit, press Ctrl X.

After that, we need to run the following command to change all instances of bionic to disco in the source list file (/etc/apt/sources.list). Bionic is the code name for Ubuntu 18.04, whereas disco is the code name for Ubuntu 19.04.

sudo sed -i 's/bionic/disco/g' /etc/apt/sources.list

Then we need to disable third-party repositories (PPAs) with the command below.

sudo sed -i 's/^/#/' /etc/apt/sources.list.d/*.list

After you disable third-party repositories, run the following commands to update software sources and upgrade software to the latest version available in the Ubuntu 19.04 repository. This step is called minimal upgrade.

sudo apt update

sudo apt upgrade

If the apt-listchanges shows up during the upgrade, you can press the Q key to return to the main screen.

Once minimal upgrade is finished, run the following command to begin full upgrade.

sudo apt dist-upgrade

If you see this error:

Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Then run the following command to fix the error.

sudo apt update

And re-run

sudo apt dist-upgrade

Now you can remove obsolete/unneeded software packages from your Ubuntu system.

sudo apt autoremove

sudo apt clean

Finally, reboot the system.

sudo shutdown -r now

Once restarted, you can open up terminal window and check your Ubuntu version.

lsb_release  -a

You should see the following text.

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.04
Release:        19.04
Codename:       disco

How to Re-Enable Third-Party Repositories

Third-party repositories are defined in the .list files under /etc/apt/sources.list.d/ directory. First, re-enable third-party repositories with the following command, which will remove the # character in lines that begin with deb.

sudo sed -i '/deb/s/^#//g' /etc/apt/sources.list.d/*.list

Then change all instances of bionic to disco.

sudo sed -i 's/bionic/disco/g' /etc/apt/sources.list.d/*.list

Update package repository index.

sudo apt update

Some third-party repositories don’t have an entry for Ubuntu 19.04, so you will likely to see errors like:

E: The repository 'http://linux.dropbox.com/ubuntu disco Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

You will need to edit these repository files one by one and change disco back to bionic. For example, I edit the Dropbox repository file.

sudo nano /etc/apt/sources.list.d/dropbox.list

Change disco back to bionic. Save and close the file.

Wrapping Up

Congrats! You have successfully upgraded Ubuntu 18.04 directly to Ubuntu 19.04 from the command line. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

Rate this tutorial

[Total: 34 Average: 4.9]