Update and upgrade packages on Debian/Ubuntu with apt
Refresh the package index from all configured repositories, then install newer versions of every upgradable package.
01Command
$ sudo apt update && sudo apt upgrade02What it does
apt update only refreshes the local index of what versions are available; apt upgrade actually downloads and installs new versions of installed packages (it never removes packages). Use sudo apt full-upgrade instead when distro upgrades require removing or replacing packages. Check what will change first with apt list --upgradable, and hold a package back with sudo apt-mark hold <pkg>. Reboot when /var/run/reboot-required exists so kernel or library updates take effect.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- AptCLI - Debian WikiEvidence: The Debian Wiki AptCLI page recommends apt update to refresh package indexes followed by apt upgrade to install available upgrades.
- apt(8) — command-line interface for the APT package systemEvidence: The apt(8) manual documents 'update' as resynchronizing the package index files and 'upgrade' as installing available upgrades of all packages.
Last verified: 2026-09-17 · Category: System & Settings
06Related solutions
Open your personal cron table in an editor to add, change, or remove scheduled jobs that run automatically.
Filter the systemd journal to error-priority messages from the current boot, with timestamps, unit names, and full message text.
Refresh repository metadata and upgrade every installed package to its latest available version on DNF-based systems.