Home·Terminal commands
Ad

Claim your crypto exchange bonus

Bonuses you get just for signing up. Terms are copied straight from each exchange.

apt update

Packages and runtimes

Usage

sudo apt update

Refreshes the package lists and nothing else, so apt upgrade has to follow to actually install anything; a fresh container has an empty list, which makes this the first command.

Common flags

FlagMeaning
apt upgradethe second half: actually install the newer versions
apt full-upgradeallow packages to be removed to finish the upgrade
apt list --upgradableshow what the refresh found
-qquieter output for logs and CI
--allow-releaseinfo-changeaccept a repository that renamed its suite

Examples

sudo apt update

refreshes the package lists only

sudo apt update && sudo apt upgrade -y

refresh, then install the updates

apt list --upgradable

lists the packages that now have a newer version

The question is always what goes where: inside this project, or on the whole machine.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

QWhat does apt update do?

Refreshes the package lists and nothing else, so apt upgrade has to follow to actually install anything; a fresh container has an empty list, which makes this the first command.

QHow do I type it?

sudo apt update — square brackets mark the parts you can leave out.

QHow many flags are worth knowing?

5 are listed here; the full set is in man apt. This command sits under Packages and runtimes.

Related commands

man page: man apt-update