How to Upgrade Ubuntu Linux

The post outlines the procedure to upgrade Ubuntu Desktop or Server from a previous version, indicating that Ubuntu LTS versions are supported for five years and STS versions are supported for about 9 months. To begin, you must first update all installed packages to their latest versions, then remove any dependencies no longer needed. Then,…

This post shows steps for students and new users to upgrade Ubuntu Desktop or Server from a previous version. If you have a decent Internet connection, upgrading to the next Ubuntu version is straightforward.

Ubuntu Linux has two support flavors: Long Term Support (LTS) and Short Term Support (STS). Ubuntu LTS versions are typically supported for five ( 5 ) years, while the STS versions are supported for roughly 9 months.

Ubuntu LTS versions will typically see upgrade notifications when new LTS releases are available. STS versions will also only see upgrade notifications for newer STS releases. Upgrading from one version to the next is pretty straightforward. However, some work must be done before successfully upgrading if you’re on an LTS release version and want to upgrade to an STS version.

If your version of Ubuntu is two releases back, you’ll have to upgrade to the next release version in line before you can upgrade to the latest or most current release version.

Above are some details you may want to know before upgrading to Ubuntu Linux.

To get started with upgrading Ubuntu Linux, follow the steps below.

How to update Ubuntu packages

Before starting the release upgrade, updating all currently installed packages or software to their latest versions is recommended.

If you have packages installed on Ubuntu and are marked as held back, those cannot be automatically installed, upgraded, or removed. This may cause issues during the upgrade process.

Run the commands below to check whether packages are being held back on your systems.

sudo apt-mark showhold

If packages have a hold on them, run the commands below to release the hold.

sudo apt-mark unhold package_name

Replace package_name with the package’s name being held from updates or upgrades.

After that, run the commands below to update and upgrade all installed packages.

sudo apt update
sudo apt upgrade

You may sometimes have to reboot before continuing with the release upgrade.

Next, run the commands below to perform a major upgrade or installed packages.

sudo apt full-upgrade

Next, run the commands below to automatically remove installed package dependencies that are no longer needed on Ubuntu.

sudo apt --purge autoremove

Once the steps above are done, continue below with the upgrade.

How to perform a release upgrade on Ubuntu Linux

Now that the current Ubuntu version is updated continue with the release upgrade below. As mentioned above, the upgrade process is pretty straightforward.

You can upgrade from the command line with do-release-upgrade or using the desktop GUI update tool Software Updater. The command line option works for both Ubuntu desktop and server editions.

First, make sure that the upgrade package is installed. Run the commands below if it’s not already installed.

sudo apt install update-manager-core

After installing the package above, run the commands below to start the upgrade process.

sudo do-release-upgrade -d

The above command will turn off all third-party repositories and change the apt list to the Ubuntu upgrade version repositories. You will be prompted several times to confirm that you want to continue the upgrade.

Follow the on-screen instructions. y = yes and N= No. When prompted whether you wish to upgrade, type y.

Do you want to start the upgrade? 

5 packages are going to be removed. 85 new packages are going to be 
installed. 1168 packages are going to be upgraded. 

You have to download a total of 803 M. This download will take about 
11 minutes with your connection. 

Installing the upgrade can take several hours. Once the download has 
finished, the process cannot be canceled. 

 Continue [yN]  Details [d]

Wait for all the newer packages to be downloaded. This may take a while, depending on your Internet connection speed. After all, packages are downloaded, your system will begin upgrading immediately.

Once the new packages are installed, the update tool will ask if you want to remove the obsolete software. If you have a system that you have customized, you may wish to enter d to view the list, just in case you may need to reinstall.

Remove obsolete packages?

53 packages are going to be removed.

 Continue [yN]  Details [d]y

When asked whether you want the services to be automatically restarted during the upgrade, type y for Yes.

When the upgrade process is complete assuming all went well, you’ll be prompted to restart. Type y to restart your computer to finish setting up your system.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN] y

Once your system is restarted, your Ubuntu system has fully upgraded to the next release version. You can run the commands below to check the current version.

lsb_release -a

That should output similar lines as shown below:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

Conclusion:

This post showed you how to upgrade Ubuntu Linux. As you can see above, the steps are relatively painless and straightforward. Please use the comment form below if you find any errors above or have something to add.

Richard Avatar

Comments

  1. thanks for this, but I could use some clarification

    —–

    > First, make sure that the upgrade package is installed. Run the commands below if it’s not already installed.

    > sudo apt install update-manager-core

    what does update-manager-core actually do? googling didn’t seem to help

    > After installing the package above, run the commands below to start the upgrade process.

    >sudo do-release-upgrade -d

    > The command above will disable all third-party repositories and change the apt list to point to the Ubuntu upgrade version repositories

    How to I re-enable them later? Will their repository sources still be in the /etc/apt/sources.list.d

Leave a Reply to Jerry Cancel reply

Your email address will not be published. Required fields are marked *


Exit mobile version