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

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.

apt-listchanges

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]

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

  • Rodney Jackson
    5 years 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

    • Xiao Guo An (Admin)
      5 years ago

      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
    5 years 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.

    • Xiao Guo An (Admin)
      5 years ago

      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?

    • Xiao Guo An (Admin)
      5 years ago

      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
    5 years 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
    5 years 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.

  • Flawless. This is a first for me to upgrade version with out formatting first. Thanks!

  • steelanterns
    5 years ago

    and for the users in dual boot, will that not pose any problems

    • Xiao Guo An (Admin)
      5 years ago

      Dual booting will not cause problem when you upgrade.

  • grimpressive
    5 years ago

    Hi,
    the procedure went smooth, I had issues after the last reboot at the end because the system won’t let me sign in anymore, either in the graphical gui whether on a tty saying “Login incorrect”.

    I just restored the 18.04 from systemback live usb, I think issues occurred with kerberos during the upgrade process… Any suggestions?

  • “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. “: Can you please cite the source for it?

    I’m an Ubuntu user since a very long time. Once a release reaches EOL, all repository information is moved to old-releases but the upgrade path remains the same. However, LTS to LTS upgrade can be done directly skipping the non-LTS releases in between. So, 18.04->20.04 will go directly.

    • Xiao Guo An (Admin)
      5 years ago

      I don’t bother finding an official document to support my words. I wrote that sentence from my years of experience 🙂

      The upgrade path must change when Ubuntu 18.10 reaches end-of-life. Just think about it. How can Canonical let Ubuntu 18.04 users upgrade to 18.10 when the latter is not supported any more? 18.10 repository will be moved to old-releases. There’s no way 18.04 users can upgrade to 18.10 when that happens. So Canonical must allow 18.04 users to upgrade to 19.04 directly 🙂

      • “I don’t bother finding an official document to support my words”: That’s your personal choice. However, I asked for source since you are mentioning with confidence, I expected that you might have some official source.

        “The upgrade path must change when Ubuntu 18.10 reaches end-of-life.”: No. Every release is important if you aren’t updating LTS to LTS. Those releases may/may not remove obsolete packages. On Ask Ubuntu, there are hundreds of questions to upgrade EOL releases but the path remains same. Moreover, if a user wanted to upgrade to every new release they might have done that in those 9 months when non-LTS releases were supported.

    • Xiao Guo An (Admin)
      5 years ago

      I didn’t say about the upgrade path for Ubuntu 18.10. What I’m expecting is that when 18.10 reaches EOL, 18.10 users can upgrade to 19.04. And when 19.04 reaches EOL, 18.10 users can upgrade to 19.10 directly. But I’m not 100% certain.

      You originally questioned the upgrade path for Ubuntu 18.04. And I’m 100% certain that after 18.10 reaches EOL, 18.04 users can upgrade directly to 19.04 with standard upgrade procedure.

      If you don’t believe me, just wait for 18.10 to reach EOL, then install 18.04 in Virtualbox, change Prompt=lts to Prompt=normal and run do-release-upgrade.

    • Xiao Guo An (Admin)
      5 years ago

      Perhaps the following screenshot will convince you. This screenshot was taken 2 years ago. After updating software on Ubuntu 16.04, the update manager prompted me to upgrade to 17.04.

      ubuntu 18.04 to 19.04

    • Xiao Guo An (Admin)
      5 years ago

      Ubuntu 18.10 reached end of life on July 18, 2019.

      Now if you use Ubuntu 18.04, change Prompt=lts to Prompt=normal in /etc/update-manager/release-upgrades and run do-release-upgrade, you will be able to upgrade to Ubuntu 19.04 (disco dingo) directly.

      ubuntu 18.04 upgrade directly to ubuntu 19.04

  • This operation is not for the faint at heart. You may want to start by installing “dselect”, and do multiple usages of the “C”onfiguration option between failing to install chunks of packages. If you have additional archives in /etc/apt/sources.d you may want to remove some of these things before you upgrade- otherwise you may have so many packages failing to install under “apt” that you are unable to do the apt -fix thing.

    It does work though if you don’t freak yourself out looking at a lot of unrecoverable-looking errors.

    • Xiao Guo An (Admin)
      5 years ago

      I think I have said in this article that running the following command will disable third party repositories in /etc/apt/sources.list.d/ directory.

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

      This will add a # character at the beginning of line for every .list file in /etc/apt/sources.list.d/ directory.

      • Jonathan
        5 years ago

        What do you do after the upgrade to your edited files then?

        • Xiao Guo An (Admin)
          5 years ago

          First, re-enable third-party repositories with the following command:

          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.

          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.

          So you will need to edit these repository files one by one and change disco back to bionic.

        • Jonathan
          5 years ago

          Thanks for this. Yesterday, I went and manually re-added all the PPAs and reviewed the updates to *.list, and deleted the old `bionic` references where applicable. Your approach may create confusion by having .list files named explicitly as `bionic`, but actually having `disco` references.

          My list wasn’t too long, so it wasn’t too much of a pain to do this manually.

        • Xiao Guo An (Admin)
          5 years ago

          The /etc/apt/sources.list.d/ directory on my Ubuntu 19.04 computer does have many files with bionic and also xenial in the filename. LOL.

  • Ed Bugayov
    5 years ago

    To un-comment the lines that start with deb and revert back, run this code

    sudo sed -i '/deb/s/^#//g' /etc/apt/sources.list.d/*.list
  • Thanks a lot – worked great!

  • Thank you so much..:)

  • Thanks so much. It worked fine.

  • ProDigit
    5 years ago

    pretty lengthy procedure,
    with gui all you need to do is install update-manager, and run it.

    • Xiao Guoan (Admin)
      5 years ago

      This article said: “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.”

      The method described in this article is for those don’t want to wait 3 months and don’t like upgrading twice, when 18.10 was still supported.

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.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here