Last updated:

Quick answer: open a terminal and run sudo apt update && sudo apt upgrade -y. apt update refreshes the list of available packages, and apt upgrade installs the newer versions. If you use the desktop, open Software Updater instead. This works the same on Ubuntu 26.04, 24.04 and 22.04. It updates packages inside your current release; it does not move you to a newer Ubuntu version.

There are two ways to update Ubuntu: the terminal (apt) and the graphical Software Updater. Both install the same security and bug-fix updates, so use whichever you prefer. The screenshots below come from the original version of this guide and show Ubuntu 22; the commands are unchanged on current releases. I re-checked the apt list --upgradable and apt full-upgrade behaviour on Ubuntu 24.04, but the Software Updater steps are shown only with the original screenshots.

Update vs upgrade: what each command does

CommandWhat it doesWhen to use it
sudo apt updateDownloads the current package lists from the repositories. Installs nothing.Always first
sudo apt upgradeInstalls newer versions of installed packages. Does not remove packages or install new dependencies that need changes it considers risky.Routine updates
sudo apt full-upgradeLike upgrade, but may also install or remove packages to resolve changed dependencies, which new kernels sometimes require.When upgrade reports packages “kept back”
sudo apt autoremoveRemoves packages that were installed as dependencies and are no longer needed.After updating, to free disk space

Method 1: Update Ubuntu from the terminal

Step 1: Refresh the package lists

sudo apt update

The command needs sudo because it changes system files. The last line of the output tells you how many packages can be upgraded.

Terminal running sudo apt update on Ubuntu and refreshing the package lists
Output of apt update, from the original version of this guide (Ubuntu 22).

Step 2: See what will be upgraded (optional)

apt list --upgradable

This lists each package with its new and current version, so you can see what the next step will change before you run it.

Step 3: Install the updates

sudo apt upgrade

Review the list and press Y to confirm.

Terminal running sudo apt upgrade and installing the available package updates
Output of apt upgrade, from the original version of this guide (Ubuntu 22).

To run both steps in one line, and answer yes automatically, use:

sudo apt update && sudo apt upgrade -y
Terminal running sudo apt update && sudo apt upgrade -y in one command
The two commands combined, from the original version of this guide (Ubuntu 22).

The && means the upgrade only starts if the update succeeded. Avoid -y on servers where you want to read the package list before accepting it.

Upgrade a single package

To upgrade only one installed package, name it. Here nginx is the example:

sudo apt install --only-upgrade nginx

The older form sudo apt upgrade nginx from the original version of this guide also works on current releases, but --only-upgrade makes clear that nothing new will be installed if the package is missing.

Terminal running sudo apt upgrade nginx to upgrade a single package
Upgrading one package (nginx), from the original version of this guide (Ubuntu 22).

Step 4: Clean up and check whether a reboot is needed

sudo apt autoremove
Terminal running sudo apt autoremove to remove unneeded packages
Output of apt autoremove, from the original version of this guide (Ubuntu 22).

Kernel and some library updates only take effect after a restart. Ubuntu creates the file /var/run/reboot-required when that is the case:

ls /var/run/reboot-required

If the file exists, reboot with sudo reboot when it is convenient. If you see “No such file or directory”, no restart is pending.

Method 2: Update with Software Updater (desktop)

Search for Software Updater in the Ubuntu Desktop search box and open it:

Searching for Software Updater in the Ubuntu Desktop search box
Opening Software Updater, from the original version of this guide (Ubuntu 22 desktop).

It checks for updates and starts downloading them automatically:

Software Updater downloading updates for Ubuntu packages
Software Updater downloading updates, from the original version of this guide (Ubuntu 22 desktop).

When it finishes installing, it shows the message “The software on this computer is up to date”:

Software Updater showing the message that the software on this computer is up to date
Software Updater finished, from the original version of this guide (Ubuntu 22 desktop).

Update vs upgrade Ubuntu to a new release

Everything above installs updates inside your current release, for example Ubuntu 24.04 stays 24.04. Moving to a newer release (for example 24.04 to 26.04) is a different, bigger operation, normally done with do-release-upgrade and only after a full backup. Do it on a test machine first, and never on a production server without a backup and a rollback plan. I did not test a release upgrade for this article.

Troubleshooting

MessageMeaningWhat to do
Could not get lock /var/lib/dpkg/lock-frontendAnother update process (often the automatic updater) is runningWait a few minutes and retry. Do not delete lock files.
“The following packages have been kept back”The upgrade needs dependency changes apt upgrade will not makeRun sudo apt full-upgrade after reading the proposed changes
Temporary failure resolving / Failed to fetchNo network or DNS, or a repository is unreachableCheck the connection, then run sudo apt update again
Updates are held back on a serverUnattended updates or pinned packagesCheck apt-mark showhold for held packages

FAQ

How often should I update Ubuntu? Check at least weekly, and apply security updates as soon as they appear on any machine reachable from the internet.

Is apt update the same as apt upgrade? No. update only refreshes the package lists; upgrade installs the new versions.