Linux Survival Basics
Read-onlyList Installed Debian Kernels
You need Debian/Ubuntu kernel package names and versions.
Command
dpkg -l 'linux-image*' | awk '/^ii/{print $2,$3}'
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not remove the running kernel.
Expected output
Installed Linux image packages and versions.
System impact
Read-only. Nothing changes. The command reads current state and prints diagnostic evidence.
Recovery / rollback: no state is changed.
When to use it
Use after confirming /boot pressure.
When not to use it
Do not remove the running kernel.
Example run
Commands shown
These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.
dpkg -l 'linux-image*'dpkg -l 'linux-image*' | awk '/^ii/{print $2,$3}'
next steps
Related commands
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$/'
Show Context Around the First App Error
The first error often explains more than the last one.
awk '{buf[NR%5]=$0} tolower($0) ~ /(error|exception|fatal)/ {for (i=NR-4;i<=NR;i++) if (i>0) print buf[i%5]; exit}' /var/log/app/app.log
Map systemd Timers to Services
A timer is only half the scheduled job. The service is the payload.
systemctl list-timers --all --no-pager --plain | awk 'NR==1 || /\.timer/ {print $(NF-1), "->", $NF}'
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 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
next diagnostic step
Where to go from this command
- Boot partition full hub Use to identify installed kernels.
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.