Upgrade Ubuntu 18.04 to Ubuntu 19.04 Directly From Command Line

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.

ubuntu 18.10 is now available, you have ubuntu 18.04

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

upgrade to ubuntu 19.04 from command line

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

If you have added third-party repositories (PPAs) in the /etc/apt/sources.list file and in /etc/apt/sources.list.d/ directory, please disable third-party repositories. For example, I added the qBittorrent PPA when I was installing qBittorrent on Ubuntu 18.04, but this PPA doesn’t support Ubuntu 19.04 yet, so I open the PPA file.

sudo nano /etc/apt/sources.list.d/qbittorrent-team-ubuntu-qbittorrent-stable-bionic.list

And comment out every line in that file by adding the # symbol at the beginning of each line.

#deb http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu bionic main
#deb-src http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu bionic main

Save the file and you are done. 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

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

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: 14 Average: 4.9]

report this ad

10 Responses to “Upgrade Ubuntu 18.04 to Ubuntu 19.04 Directly From Command Line

  • Rodney Jackson
    5 days ago

    Hello all, I am using ubuntu 16.04. If I upgrade to 18.04 or even 19.04 will I lose everything I currently have.?

    Thank you for your time.

    Rod

    • Hi Rodney,

      The upgrade process will upgrade the base system, but won’t remove the software you installed or the files you created. If everything goes well, you will have a system with all your software and files intact.

      But I must admit that there’s a bit chance the upgrade can fail. For Ubuntu 16.04 users, I recommend upgrading to 18.04, which is safer than upgrading directly to 19.04.

  • Rodney Jackson
    4 days ago

    Thank you Xiao Guo An, I will try and upgrade to 18.04 first, then if my programs still work OK, I will go and upgrade to 19.04

    Thank you again, I appreciate your help and guidance.

    Rodney.

    • Hi Rodney,

      It just occurred to me that there’s a program called systemback that can create a bootable ISO image from your current OS. Every program and file can be included in the ISO.

      Before doing the upgrade, you can use systemback to create ISO image. If the upgrade fails, you can easily restore your previous OS.

      Hope this helps 🙂

  • hi, i just successfully upgraded from 18.04 to 19.04 using this guide. i noticed that my kernel is still “4.15.0-46-generic”. isn’t it supposed to upgrade to kernel 5.0 in 19.04?

    • Yes, Ubuntu 19.04 comes with kernel 5.0. The upgrade should have installed it on your system. You can run

      sudo update-grub

      to find out if kernel 5.0 is installed on your system. Note that you need to reboot your computer after the upgrade in order to use kernel 5.0.

      If you don’t see kernel 5.0 in the list, you can install it with the following command.

      sudo apt install linux-headers-5.0.0-13

      Then update the Grub boot menu

      sudo update-grub

      And reboot your system.

  • Rodney Jackson
    3 days ago

    Hello again Xiao Guo An, thank you for the update.
    I have successfully upgraded to 18.04. I did have some problems after doing so.
    First, the screen was black, the left side programs were still there.
    Second, when I got the desktop back again, the folders would not open.
    Lastly, the internet wouldn’t work. Using my Raspberry Pi, I was able to go online and Google the answers to these problems.

    I will give the program you mentioned a try and see if I can get a good image of my working drive.

    One query, I have 2 identical hard drives. Both 2TB, and the computer boots from wherever it wants. I have temporarily solved this by unplugging the image drive. It takes whichever drive it wants to boot from. /dev/sda. I have changed the desktop picture from the image drive so I recognise the difference. Is there a way to stop this from happening.?

  • Lalnuntluanga
    2 days ago

    Today I upgraded my Ubuntu 18.04 to 19.04. Thanks to this article. The reason for my upgrade is because of the scroll bug in chromium based applications which haunt the previous version of GNOME.

  • @Rodney. Your disks probably have the same UUID from cloning ? You can google on “ change uuid “ to find your solution.

  • Hi I was using ubuntu 18.04 and upgrade it to 18.10 but when i try to install 19.10 y get the massage that i have a network problem, but i checked and network is ok, what can i Do?

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • If my answer helped you, please consider supporting this site. Thanks :)