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.
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
List Installed Debian Kernels
Know installed kernels before cleanup.
dpkg -l 'linux-image*' | awk '/^ii/{print $2,$3}'
Find Running Package Manager Processes
A package lock is usually a symptom, not the first thing to delete.
ps -ef | grep -E 'apt|dpkg|dnf|yum|pacman' | grep -v grep
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.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.