Interview Q&A / Linux & Shell

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the difference between apt update and apt upgrade?

SHORT ANSWER

apt update refreshes the local list of available packages and versions from the repositories but installs nothing. apt upgrade then installs newer versions of the packages you already have. Run update first, otherwise upgrade works from stale information.

Explain it simply

Think of checking a shop's price list versus actually buying. apt update downloads the latest catalogue. apt upgrade goes shopping based on that catalogue.

sudo apt update contacts the repositories listed in /etc/apt/sources.list and /etc/apt/sources.list.d/, then stores fresh package indexes locally. It changes no software. It ends with a line such as "12 packages can be upgraded".

sudo apt upgrade installs newer versions of installed packages. It never removes packages, and it holds back any upgrade that would need a removal or a new dependency set.

sudo apt full-upgrade (older name dist-upgrade) is allowed to remove or add packages to resolve such cases, and is used for moving between distribution releases.

If you skip update, apt install something may fail with a "404 Not Found" because the local list points at a version that is no longer on the mirror.

Example

bash
sudo apt update
# Reading package lists... Done
# 12 packages can be upgraded. Run 'apt list --upgradable' to see them.
apt list --upgradable
sudo apt upgrade -y

What to say in the interview

"update refreshes the package index only; upgrade installs newer versions of installed packages. I always run update first. For changes that need removals I use full-upgrade, and on servers I review apt list --upgradable first."

Common mistakes

  • Thinking apt update installs new software versions.

#linux#package-managers#apt

Related questions

Practise more Linux & Shell questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Linux & Shell quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.