Ubuntu gets its security and bug fixes as package upgrades. Two commands install them all: sudo apt update to refresh the package list, then sudo apt upgrade.
Every command and output on this page is real, from Ubuntu 26.04 LTS.
Syntax
sudo apt upgrade [-y]
sudo: runs the command as the administrator, which installing software needs.apt: Ubuntu’s package manager.upgrade: installs the newer versions of the packages you have. It installs new packages when an upgrade needs them, and never removes any.-y: optional. Answers yes to apt’s question, so the upgrade doesn’t stop to ask.
The parts come from apt’s manual page (opens in a new tab) for Ubuntu 26.04, and -y from apt-get’s (opens in a new tab).
Prerequisites
- A user account that can run commands with
sudo.
Step 1: Refresh the Package List
Upgrades come from the package list, so refresh it first:
sudo apt update
Fetched 4463 kB in 5s (854 kB/s)
32 packages can be upgraded. Run 'apt list --upgradable' to see them.
The last line says how many packages can be upgraded. How to Update the Package List on Ubuntu explains the rest of this output.
Step 2: See What Will Be Upgraded
apt list --upgradable
bpftool/resolute-updates 7.7.0+7.0.0-44.44 arm64 [upgradable from: 7.7.0+7.0.0-43.43]
cloud-init-base/resolute-updates,resolute-security 26.2-0ubuntu1~26.04.2 all [upgradable from: 26.2-0ubuntu1~26.04.1]
cloud-init/resolute-updates,resolute-security 26.2-0ubuntu1~26.04.2 all [upgradable from: 26.2-0ubuntu1~26.04.1]
distro-info/resolute-updates 1.15ubuntu0.1 arm64 [upgradable from: 1.15]
fwupd/resolute-updates 2.1.6-3ubuntu4~26.04.1 arm64 [upgradable from: 2.1.1-1ubuntu3.1]
Each line names a package, the new version and, in brackets, the version you have. When the list is longer than your window, apt shows it in a pager: scroll with the arrow keys and press q to close it.
Step 3: Upgrade the Packages on Ubuntu
sudo apt upgrade
apt lists the packages it will upgrade and install, then asks before it starts:
Summary:
Upgrading: 32, Installing: 7, Removing: 0, Not Upgrading: 0
12 standard LTS security updates
Download size: 419 MB
Space needed: 595 MB / 16.3 GB available
└─ in /boot: 108 MB / 663 MB available
Continue? [Y/n] Y
Type Y and press Enter. apt downloads the packages and installs them. On this computer it upgraded 32 packages and added 7 new ones, among them a newer Linux kernel.
Step 4: Restart Ubuntu When apt Asks
When an upgrade installs a new Linux kernel, the end of the output asks for a restart:
Pending kernel upgrade!
Running kernel version:
7.0.0-43-generic
Diagnostics:
The currently running kernel version is not the expected kernel version
7.0.0-44-generic.
Restarting the system to load the new kernel will not be handled automatically,
so you should consider rebooting.
Restart Ubuntu, so it starts with the new kernel:
sudo reboot
Your terminal session ends while Ubuntu restarts. Log in again when it’s back. If Ubuntu runs in a Multipass VM and the VM shows as Stopped, start it again in the Multipass app.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Upgrading without running sudo apt update first | apt works from its last package list, so newer fixes are missed | Run sudo apt update, then sudo apt upgrade. |
| Not restarting after a kernel upgrade | Ubuntu keeps running the old kernel until it restarts | Run sudo reboot when the output says Pending kernel upgrade!. |
FAQ
What’s the difference between apt upgrade and apt full-upgrade?
apt upgrade never removes a package. apt full-upgrade does the same upgrade, but removes installed packages when that’s needed to upgrade the system as a whole.
Can I upgrade without answering the question?
Yes: sudo apt upgrade -y answers yes for you. Without -y you see what will change before anything is installed.
Does apt upgrade move me to a new Ubuntu release?
No. It upgrades the packages of the release you have. Moving to a new release, such as from 24.04 to 26.04, is a separate process, explained in Ubuntu’s guide to upgrading your release.
Conclusion
Run sudo apt update, then sudo apt upgrade, answer Y, and restart when apt asks. That keeps every package on your Ubuntu machine current, including the fixes for security problems.
Additional Resources
- Ubuntu manual page: apt (opens in a new tab)
- Ubuntu manual page: apt-get (opens in a new tab)
- Ubuntu Server documentation: Package management (opens in a new tab)
- Ubuntu Server documentation: Upgrade your release (opens in a new tab)
0 comments