Upgrade Ubuntu 18.04 to Ubuntu 19.10 Directly From Command Line

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

Why Ubuntu 18.04 Needs to Upgrade to 19.04 First?

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

upgrade ubuntu 18.04 to ubuntu 19.10 desktop

This is due to the fact that Ubuntu 19.04 is still being supported by Canonical and hasn’t reached end-of-life yet. After Ubuntu 19.04 reaches end-of-life in January 2020, Ubuntu 18.04 users can upgrade to 19.10 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.10 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.10 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.10-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 eoan in the source list file (/etc/apt/sources.list). Bionic is the code name for Ubuntu 18.04, whereas eoan is the code name for Ubuntu 19.10.

sudo sed -i 's/bionic/eoan/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.10 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.10
Release:        19.10
Codename:       eoan

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 eoan.

sudo sed -i 's/bionic/eoan/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.10, so you will likely to see errors like:

E: The repository 'http://linux.dropbox.com/ubuntu eoan 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 eoan back to bionic. For example, I edit the Dropbox repository file.

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

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

Wrapping Up

Congrats! You have successfully upgraded Ubuntu 18.04 directly to Ubuntu 19.10 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: 8 Average: 5]

5 Responses to “Upgrade Ubuntu 18.04 to Ubuntu 19.10 Directly From Command Line

  • Nilesh Kumar Gupta
    3 weeks ago

    Thanks for the post, Was able to successfully upgrade from ubuntu 18.04 to ubuntu 19.10. Although my space in root ran out at one time, I had to run

    sudo apt clean

    to able to make space, otherwise all other steps happened peacefully.

  • Perhaps replace mention of ‘disco’ with ‘eoan’?

  • Nasher_87(ARG)
    3 weeks ago

    No is better ‘sudo do-release-upgrade -c’ directly?

    • The -c option makes the command check for new releases. It would not upgrade the system.

      [email protected]:~$ do-release-upgrade -c
      Checking for a new Ubuntu release
      New release '19.04' available.
      Run 'do-release-upgrade' to upgrade to it.

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.
  • If you ask me more than 5 questions, I expect you to make a donation, or I would stop answering your questions.