How to Upgrade Ubuntu Linux
Upgrading Ubuntu Linux moves your operating system to a newer version, bringing you the latest features and security patches.
This process ensures your system runs smoothly with up-to-date performance improvements.
Ubuntu offers two main release types: Long Term Support (LTS) with a 5-year security update window, and Short Term Support (STS) for about 9 months.
Typically, you’ll get notified for upgrades to the next LTS or STS version based on your current track.
If your current version is more than two releases behind the latest stable version, you might need to perform an intermediate upgrade first.
Update your system using `sudo apt update` and `sudo apt upgrade`. Then, start the release upgrade with `sudo do-release-upgrade -d`. Follow the on-screen prompts to complete the installation.
How to update Ubuntu packages
Updating your Ubuntu packages first makes sure your system has the latest software before you upgrade to a new version. This step helps prevent problems during the upgrade by ensuring all your current programs are up-to-date and ready for the change.
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
Performing a release upgrade on Ubuntu Linux lets you move to the newest version of the operating system, bringing fresh features and security updates. You can do this easily using the command line with a simple command or through the graphical update tool in Ubuntu’s desktop.
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] yOnce 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.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
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