loading...
Cover image for Upgrading Ubuntu Server from 19.04 to 20.04 (Focal Fossa)

Upgrading Ubuntu Server from 19.04 to 20.04 (Focal Fossa)

nhsdeveloper profile image Paul Bradley Originally published at paulbradley.org ・2 min read

Preparation

Before upgrading your Ubuntu server take a backup or snapshot of your existing server so that you can restore it to a working server if the upgrade fails at any point. Most hosting providers offer a facility via their control panel to make a snap shot backup. It's probably best practice to take this snap shot while the server is powered down.

Upgrading to Ubuntu 20.04 LTS (Focal Fossa) is a good idea as it's a long term support release which means you'll get security updates for the next five years. Focal Fossa comes with a lot of new packages and major software upgrades, including the latest versions of Java, Python, Ruby, PHP and many more. This release is based on the Linux 5.4 LTS kernel and adds support for new hardware and file systems.

Check for held packages & update

Start by checking if you have any held packages by using the the showhold command. If you do have any then mark them as un-held by issuing an unhold command followed by the package names listed in the previous command.

sudo apt-mark showhold
sudo apt-mark unhold package_name

Once you have un-held any packages, perform a standard update and upgrade and then reboot the server.

sudo apt update
sudo apt upgrade
sudo systemctl reboot

Purge & remove unwanted packages

After the server restarts then perform a full upgrade and then purge any unwanted or unused packages to recover some disk space.

sudo apt full-upgrade
sudo apt --purge autoremove

Upgrade to 20.04

At this point you're ready to upgrade from 19.04 to 20.04 by performing the release upgrade commands. As the upgrade progresses you'll be prompted to answer various questions in relation to your setup. These questions will vary depending on what software you've already installed and configured on your Ubuntu server.

sudo apt install update-manager-core
sudo do-release-upgrade -d

Verifying the version number after the upgrade

After the upgrade has completed and the server has rebooted you can check the current version of your Ubuntu server by checking the release version.

lsb_release -a

Which should output something like.

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:    20.04
Codename:   focal

Posted on by:

nhsdeveloper profile

Paul Bradley

@nhsdeveloper

Technical Development Manager. AWS Architect. IHE Expert. HL7 & FHIR health interoperability. GoLang. Teaches kids coding. A budding cornet musician.

Discussion

markdown guide