Linux Survival Basics
Read-onlySee Which Packages Want Updates
You need to see pending package updates without changing the system.
Command
apt list --upgradable
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not assume this refreshes repository metadata; apt update is a separate state-changing network operation.
Expected output
Apt rows showing package names, candidate versions, architectures, and installed versions.
System impact
Read-only. Nothing changes. The command reads apt metadata and prints packages with newer candidate versions.
Recovery / rollback: no state is changed.
When to use it
Use before maintenance windows, security patch review, or explaining why a host is behind.
When not to use it
Do not assume this refreshes repository metadata; apt update is a separate state-changing network operation.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ apt list --upgradable
Listing... Done
curl/noble-updates 8.5.0-2ubuntu10.7 amd64 [upgradable from: 8.5.0-2ubuntu10.6]
openssl/noble-updates,noble-security 3.0.13-0ubuntu3.6 amd64 [upgradable from: 3.0.13-0ubuntu3.5]
nginx/noble-updates 1.24.0-2ubuntu7.4 amd64 [upgradable from: 1.24.0-2ubuntu7.3]
$ apt list --upgradable 2>/dev/null | sed -n '2,$p'
curl/noble-updates 8.5.0-2ubuntu10.7 amd64 [upgradable from: 8.5.0-2ubuntu10.6]
openssl/noble-updates,noble-security 3.0.13-0ubuntu3.6 amd64 [upgradable from: 3.0.13-0ubuntu3.5]
nginx/noble-updates 1.24.0-2ubuntu7.4 amd64 [upgradable from: 1.24.0-2ubuntu7.3]
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
apt list --upgradableapt list --upgradable 2>/dev/null | sed -n '2,$p'
next steps
Related commands
Check the Installed and Candidate Package Version
apt policy explains where the next version would come from.
apt policy nginx
List Installed Package Versions
A package inventory beats memory when a server is drifting.
dpkg-query -W -f='${Package}\t${Version}\t${Architecture}\n' | sort
Find the Largest Installed Packages
Disk cleanup starts with evidence, not random package removal.
dpkg-query -W -f='${Installed-Size}\t${Package}\n' | sort -nr | head -20
Spot Foreign-Architecture Packages
One unexpected architecture can explain confusing dependency output.
dpkg-query -W -f='${Architecture}\t${Package}\n' | awk '$1 != "amd64" && $1 != "all"'
Find Broken or Leftover dpkg States
Not every package row is cleanly installed.
dpkg-query -W -f='${db:Status-Abbrev}\t${Package}\n' | awk '$1 !~ /^ii$/'
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.