How to Upgrade Ubuntu Linux
Upgrading Ubuntu Linux moves your operating system to a newer version, adding the newest features and security updates.
This process keeps your computer running smoothly with the latest improvements.
Ubuntu offers Long Term Support (LTS) versions for five years of security updates, and shorter-term releases for about nine months.
You usually get a notification when an upgrade to the next LTS or short-term version is ready.
If your current Ubuntu version is more than two releases behind the latest one, you might need to do an extra step to update 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 all the latest software ready for a new Ubuntu Linux version. This step helps prevent issues during the upgrade because all your current programs will be up-to-date and prepared for the change.
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 moves your system to the newest version, giving you fresh features and important security updates. You can easily do this using the command line with a simple command or through Ubuntu’s graphical update tool.
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.
The Ubuntu upgrade package manages system updates. Install the upgrade package using the command `sudo apt update && sudo apt install update-manager-core` if the package is not already present on your computer. This ensures your system is ready for the next major Ubuntu version.
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.
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:
Upgrading Ubuntu Linux involves several straightforward steps. You can follow the instructions in this guide to successfully perform the Ubuntu Linux upgrade. For any errors or additional information regarding the Ubuntu Linux upgrade, use the comment form provided below the article.
Can I upgrade from Ubuntu 24 LTS to 25?
Ubuntu 24 LTS is a long-term support version. Ubuntu 25 is a short-term release. You typically upgrade from an LTS to the next LTS, not a short-term release. Upgrading directly from 24 LTS to 25 isn't the standard path. You'd usually wait for Ubuntu 26 LTS.
How to upgrade Ubuntu 20.04 to 22.04 terminal?
To upgrade from Ubuntu 20.04 to 22.04 using the terminal, first update your current system with `sudo apt update && sudo apt upgrade`. Then, run `sudo do-release-upgrade` and follow the on-screen prompts to complete the upgrade.
How to update Ubuntu from 18 to latest?
Upgrading directly from Ubuntu 18 to the very latest version often requires intermediate steps. You'll likely need to upgrade to 20.04 first, then to 22.04, and so on, using `sudo do-release-upgrade` after each step.
How do I update all apt?
To update all your installed software packages using apt, open your terminal and type `sudo apt update` to refresh the list of available packages. Then, run `sudo apt upgrade` to install the updates for everything.
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