apt update
Packages and runtimes
Usage
sudo apt updateRefreshes 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
| Flag | Meaning |
|---|---|
| apt upgrade | the second half: actually install the newer versions |
| apt full-upgrade | allow packages to be removed to finish the upgrade |
| apt list --upgradable | show what the refresh found |
| -q | quieter output for logs and CI |
| --allow-releaseinfo-change | accept a repository that renamed its suite |
Examples
sudo apt updaterefreshes the package lists only
sudo apt update && sudo apt upgrade -yrefresh, then install the updates
apt list --upgradablelists 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
Q. What 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.
Q. How do I type it?
sudo apt update — square brackets mark the parts you can leave out.
Q. How 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