How to upgrade Ubuntu 18.04 to 19.10 from the command line

If you have a reason for upgrading from Ubuntu 18.04 to the non-LTS 19.10, you're not out of luck. Learn how this is done from the command line.

How to upgrade Ubuntu 18.04 to 19.10 from the command line If you have a reason for upgrading from Ubuntu 18.04 to the non-LTS 19.10, you're not out of luck. Learn how this is done from the command line.

There are two types of Linux admins: Those that do distribution upgrades and those those that always start fresh. Both paths to the end result are viable and both will have your Linux machines running like champs.

Clearly, if you opt to go the fresh start route, your path is simple:

  1. Backup your data.
  2. Make certain your data is backed up.
  3. Triple check to make sure your data is backed up.
  4. Download the latest ISO of your distribution of choice (as you quadruple check your backup).
  5. Burn your distribution of choice onto a bootable USB drive.
  6. Boot your machine.
  7. Install the latest version of Linux.
  8. Copy your backed up data to the fresh install.

If you go the upgrade route, your path is most often a bit easier:

  1. Backup your data.
  2. Make certain your data is backed up.
  3. Triple check to make sure your data is backed up.
  4. Quadruple check your backup just for fun.
  5. Run the backup process.
  6. Make sure everything works as expected.

It's the second route I want to address today—specifically, with Ubuntu. I'm going to walk you through the process of upgrading from Ubuntu 18.04 to the latest release, 19.10. 

Before you get started, you should know that you're upgrading from an LTS release to a non-LTS release. For some, this is a deal breaker. But for those that require the latest version (for various reasons), this upgrade might be considered a must-do. If that's you, keep reading.

SEE: Choosing your Windows 7 exit strategy: Four options (TechRepublic Premium)

What you'll need

In order to make this upgrade happen, you'll need the following:

  • A running instance of Ubuntu 18.04 (you can also do this with Ubuntu 18.10)

  • A user with sudo privileges

  • An internet connection

A word of warning

Do not run this process via SSH. Why? Should it fail, you could wind up with a mess on your hands. Instead, log in to the machine locally to run this process. 

How to upgrade Ubuntu

Since we're doing this from the command line, log in to your Ubuntu server. If your server has a GUI, make sure to open a terminal window.

From the bash prompt run a standard apt update with the command:

sudo apt-get update

Next, run a standard upgrade with the command:

sudo apt-get upgrade -y

Once the upgrade completes, reboot the system. 

Because we're moving from an LTS to a non-LTS, we cannot just run the do-release-upgrade command without arguments. To make this work, we have to inform do-release-upgrade we're moving to a development release, by using the -d option, like so:

sudo do-release-upgrade -d

If you haven't run all available upgrades for the current release, you'll receive a warning (Figure A).

Figure A

upgradec.jpg

Even after the last upgrade, there is more fun to be taken care of.

If you receive the warning, run the upgrade process once again. If that doesn't work, you might have to issue the command:

sudo apt-get dist-upgrade -y

When everything is finally upgraded on the system, clean things up with the command:

sudo apt-get autoremove -y

When autoremove finishes, run the do-release-upgrade command again. This time around it will succeed. Once the command has calculated the upgrade, you'll be asked if you want to continue (Figure B).

Figure B

upgradef.jpg

Continue or no?

OK that and the upgrade will begin. Sit back, as this will take some time. Believe it or not, the upgrade process takes longer than a fresh install. During the install, you'll have to answer a few questions, such as choosing the version of LXD snap track (Figure C).

Figure C

upgradeg.jpg

Making the selection for the LXD snap track.

The next instance you are asked to interact with the upgrade is for the cloud.cfg configuration file. This is a networking file, so unless you've modified that file (and need to keep the modifications) select the default No (Figure D).

Figure D

upgradeh.jpg

Unless you need to keep any modifications, type N or just hit Enter.

The last question prompts you to OK the removal of obsolete packages (Figure E). Go ahead and OK that.

Figure E

upgradei.jpg

Removing obsolete packages should be done.

And that should do it for the questions. The upgrade will complete and prompt you to reboot your machine. After the reboot process completes, log back in and make sure your system works as expected.

It should, because the Ubuntu distribution upgrade process is that good.

Congratulations, you've just gone from Ubuntu 18.04 to 19.10.  

Also see

ubuntuhero.jpg

Image: Jack Wallen