- Introduction
- Before you upgrade
- Backup
- Disable automatic Power Management
- Release Notes
- Upgrade policy
- Upgrading Flash
- Network upgrades
- Desktop / GUI Upgrade
- Server / Command line Upgrade
- The Debian way of upgrading
- Upgrading to development releases
- Desktop / GUI Upgrade
- Server / Command line Upgrade
- See Also
- How to Update Ubuntu Linux [Beginner’s Tip]
- Method 1: Update Ubuntu via the Command Line
- Explanation: sudo apt update
- Explanation: sudo apt upgrade
- Method 2: Update Ubuntu via the GUI [For Desktop Users]
- A few things to keep in mind about updating Ubuntu
- Cleaning up after an update
- Live patching the kernel in Ubuntu Server to avoid rebooting
- Ubuntu version upgrades are different from package upgrades
- Conclusion
Introduction
This page is a guide to upgrade supported releases of Ubuntu to other supported releases. For more information please refer to the UpgradeNotes.
To upgrade from unsupported releases of Ubuntu, see EOLUpgrades.
Before you upgrade
Backup
Please make sure you have a backup of your important data. For more on disk cloning, please see here.
Disable automatic Power Management
Ubuntu can be configured to automatically suspend and/or hibernate after a period of user inactivity. If Ubuntu is configured as such, the user starts a release upgrade, and leaves the computer unattended during the upgrade, then Ubuntu stops in the middle of the upgrade. This can causes issues, and in the worst case, cause a corrupt install. Therefore, before upgrading Ubuntu, disable any power management feature until the upgrade process is complete. In Ubuntu with Unity, you find this setting in the System Settings application, inside «Power».
Release Notes
Please read the release notes before upgrading. They contain important information for the task of installing a given release, or upgrading to it. For example, they document high-impact bugs and their workarounds.
Upgrade policy
Check the file /etc/update-manager/release-upgrades. Prompt=normal offers upgrades from any release to a newer release; Prompt=never never offers release upgrades; Prompt=lts only offers upgrades from LTS to LTS. You need root privileges to edit this file.
- On the Update manager, click on Settings.
- Select the Updates Tab
- Where it says Release Upgrade, Show new distribution releases choose Normal Releases or LTS Releases
Upgrading Flash
If you want to upgrade flash, please add the following line to your sources.list:
# Change CODENAME to your release: lsb_release -cs deb http://archive.canonical.com/ubuntu CODENAME partner
This will make sure the adobe-flashplugin package will be upgraded.
Network upgrades
Desktop / GUI Upgrade
- Open the Dash by hitting Super key on your keyboard. This may be done by either clicking the key between Ctrl and Alt that may have a Windows logo, or by clicking the Ubuntu logo in the upper left corner of the screen.
- Type «updater».
- Click the «Software Updater» icon under Applications.
- If a release upgrade is available, the Upgrade button will be active. Click it to begin upgrading.
Server / Command line Upgrade
sudo apt install update-manager-core sudo do-release-upgrade
The Debian way of upgrading
Please be aware that while this method is valid, it is not supported by the Ubuntu developers. The ubuntu-release-upgrader package, which provides do-release-upgrade, is designed to handle quirks and transitions when moving between releases of Ubuntu.
# Upgrade all the packages to the latest versions sudo aptitude update sudo aptitude safe-upgrade # Update our sources, save the original as /etc/apt/sources.list.ORIG # This step is REQUIRED, otherwise the instructions below will not upgrade a # single package. # Change karmic/lucid to your required releases eg, dapper/hardy, hardy/lucid, # jaunty/karmic, etc sudo sed -i.ORIG 's/karmic/lucid/g' /etc/apt/sources.list # Backup the /etc/apt/sources.list.d/ folder and create an empty one. # This will disable all Third Party/Launchpad PPA repositories. # These repositories can be re-enabled after a successful upgrade. sudo mv /etc/apt/sources.list.d/ /etc/apt/sources.list.d.ORIG/ sudo mkdir /etc/apt/sources.list.d/ # Upgrade your box sudo aptitude update sudo aptitude safe-upgrade sudo aptitude full-upgrade
Upgrading to development releases
Please be aware that development releases are unstable, and not suited for people who do not want to fix/report/triage bugs. If you want a stable Ubuntu version, stick to the official released versions. For added stability, choose a Ubuntu LTS release.
Desktop / GUI Upgrade
Server / Command line Upgrade
sudo apt install update-manager-core sudo do-release-upgrade -d
Beside the network upgrades you could upgrade to a development release via the Debian (manual) way. This is left as an exercise for the user.
See Also
- http://www.ubuntu.com/getubuntu/upgrading — Official upgrade documentation.
- UpgradeNotes — Upgrade notes for all Ubuntu releases
- EOLUpgrades — Upgrade End-of-Life (unsupported) releases.
Upgrades (последним исправлял пользователь brian-murray 2018-05-16 20:57:08)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
How to Update Ubuntu Linux [Beginner’s Tip]
This tutorial shows you how to update Ubuntu for both server and desktop versions. Also learn the difference between update and upgrade.
Let me give you more details. Please note that this tutorial is valid for Ubuntu 20.04, 22.04, or any other version. The command line method is also valid for Ubuntu-based Linux distributions, like Linux Mint, Linux Lite, elementary OS, etc.
One more thing. This article is about keeping your Ubuntu system updated. If you are looking for upgrading from one release to another, please check my tutorial on upgrading Ubuntu version.
Method 1: Update Ubuntu via the Command Line
First, open the terminal in Ubuntu desktop. You can find it in the menu, or use the Ctrl+Alt+T keyboard shortcut. If you are logged on to an Ubuntu server, you already have access to a terminal.
In the terminal, you just have to use the following command:
sudo apt update && sudo apt upgrade -y
It will ask for a password. You can use your account’s password. You won’t see characters on the screen while typing password in the terminal, so keep on typing your password and hit enter. This will update the packages in Ubuntu.
See, how easy it is to update Ubuntu from terminal? Now let me explain the above command.
It’s actually not a single command, it’s a combination of two commands. The && is a way to run multiple commands in Linux in a way such that the second command runs only when the previous command ran successfully.
The “-y” in the end automatically enters “yes” when the command “apt upgrade” ask for your confirmation before installing updates.
Note that you can also use the two commands separately, one by one:
sudo apt update sudo apt upgrade
It will take a little longer because you have to wait for one command to finish and then enter the second command.
More than just OS updates: Unlike Windows, Linux works with a package manager. When you run the updates, it updates all the packages installed via apt. This means updating Ubuntu will update the core operating system, Linux kernels as well as the applications installed from the software center (if they were apt packages) or installed using apt command.
Explanation: sudo apt update
This command updates the local database of available packages. If you don’t run this command, the local database won’t be updated and your system will not know if there are any new versions of packages available.
This is why, when you run the “sudo apt update” command, you’ll see lots of URLs in the output. The command fetches the package information from the respective repositories (the URLs you see in the output).
At the end of the command, it tells you how many packages can be upgraded. You can see these packages by running the following command:
Explanation: sudo apt upgrade
This command matches the versions of installed packages with the local database. It collects all of them, and then it will list those packages that have a newer version available. At this point, it will ask if you want to upgrade the installed packages to the newer version.
You can type “yes,” or “y,” or just press enter to confirm the installation of updates.
So the bottom line is that “sudo apt update” checks for the availability of new package versions, while “sudo apt upgrade” actually installs the new versions.
The term update might be confusing, as you might expect the “apt update” command to update the system by installing new software, but that’s not how it works.
Method 2: Update Ubuntu via the GUI [For Desktop Users]
If you are using Ubuntu as a desktop, you don’t have to go to the terminal to update the system. You can still use the command line, but it’s optional for you.
In the menu, look for “Software Updater” and run it.
It will check if there are updates available for your system.
If there are updates available, it will give you the option to install the updates.
Click on “Install Now.” It may ask for your password.
Once you enter your password, it will start installing the updates.
In some cases, you may need to reboot your Ubuntu system for the installed updates to work properly. You’ll be notified at the end of the update if you need to restart the system.
You can choose to restart later if you don’t want to reboot your system straightaway.
Tip: If the software updater returns an error, you should use the command “sudo apt update” in the terminal. The last few lines of the output will contain the actual error message. You can then search on the internet for that error and fix the problem.
A few things to keep in mind about updating Ubuntu
You just learned how to update your Ubuntu system. If you are interested, you should also know these few things relating to Ubuntu updates.
Cleaning up after an update
After an update, your system may have some unnecessary packages that are no longer required. You can remove such packages and free up some space by using this command:
Live patching the kernel in Ubuntu Server to avoid rebooting
In the case of Linux kernel updates, you’ll have to restart the system after the update. This can be a problem if you don’t want downtime for your server.
The live patching feature allows for the patching of the Linux kernel while it is still running. In other words, you don’t have to reboot your system.
If you manage servers, you may want to enable live patching in Ubuntu.
Ubuntu version upgrades are different from package upgrades
The update methods discussed here keep your Ubuntu install fresh and updated. It doesn’t cover OS version upgrades (for example, upgrading Ubuntu 16.04 to 18.04).
Ubuntu version upgrades are an entirely different thing. They involve updating the entire operating system core. You’ll need to make proper backups before starting this lengthy process.
Conclusion
I hope you liked this tutorial on updating the Ubuntu system, and that you learned a few new things.
If you have any questions, please fee free to ask. If you are an experienced Linux user and have some tip that can make this tutorial more useful, please share it with the rest of us.