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.

LinuxsystemTerminalMedium risk
Run sudo apt update && sudo apt upgrade and confirm the prompt to install all available package updates.

01Command

Command
$ sudo apt update && sudo apt upgrade

02What 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

RiskMedium risk
RequirementsDebian, Ubuntu, or any APT-based distro with root/sudo access and configured repositories
!Warning: Upgrading can restart services mid-run and occasionally changes configuration file behavior — review prompts about modified config files instead of blindly accepting.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • AptCLI - Debian Wiki
    Debian Wiki · vendor-doc · 2026-09-17
    Evidence: 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 system
    Ubuntu manpages · vendor-doc · 2026-09-17
    Evidence: 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