HomeLinuxHow to Upgrade Ubuntu Via Command Line?

How to Upgrade Ubuntu Via Command Line?

Suppose you’re using an older Ubuntu version and are eager to explore the new features, security enhancements, and performance improvements in Ubuntu. In that case, this guide will walk you through the upgrade process. Upgrading your Ubuntu system ensures that you’re up to date and benefiting from the latest Ubuntu has to offer.

Before embarking on any system upgrade, it’s wise to back up your essential data to prevent any data loss in case anything unexpected occurs.

Step 1: Update the current Ubuntu version

It’s crucial to begin by ensuring your existing system is fully up to date. Open a terminal and run the following linux commands:

sudo apt update && apt upgrade -y
Step 2: Prepare for the Upgrade:

To upgrade, we’ll be utilizing the do-release-upgrade command. Firstly, verify that the update-manager-core package is installed. If it’s not, you can easily install it with the following command:

sudo apt install update-manager-core
Step 3: Run the Upgrade:

Now, it’s time to kickstart the upgrade process by issuing the following command:

sudo do-release-upgrade
To upgrade to the latest non-LTS development release, set Prompt=normal in the file /etc/update-manager/release-upgrades using an editor such as vi editor or nano editor.

Throughout the upgrade process, the upgrade tool will automatically identify and initiate a series of steps to ensure a smooth transition to the latest release of Ubuntu. Initially, it will detect your SSH connection and inform you that an auxiliary SSH service will be initiated on port 1022, ensuring uninterrupted access. To proceed, simply confirm by entering ‘Y.’

Additionally, as you progress through the upgrade, the tool will prompt you for various changes and updates. It is advisable to accept these prompts by sticking to the default options there. And be patient, as this part of the process may take a bit of time.

Step 4: Post-Upgrade Cleanup:

After the upgrade is complete, it’s a good practice to remove any obsolete packages and perform some system cleanup. Execute the following commands:

sudo apt autoremove && apt clean
Step 5: Verify the Upgrade:

Once your system is back up, you should confirm the upgrade’s success. Check your Ubuntu version to ensure you’ve transitioned to the latest version:

cat /etc/os-release

You’ve successfully upgraded your Ubuntu system. Now, you can fully enjoy the latest features and enhancements that the new release has to offer.

Also Read:

Ubuntu sources.list URLs: All Versions
Scroll to Top