Linux Survival Basics
Read-onlyList Installed RPM Kernels
You need installed kernel package versions on RPM-family hosts.
Command
rpm -q kernel
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 kernel package versions or a message if the package is missing.
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 on RHEL, Fedora, Alma, Rocky, or similar systems.
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.
rpm -q kernelrpm -q kernel
next steps
Related commands
List Installed Debian Kernels
Know installed kernels before cleanup.
dpkg -l 'linux-image*' | awk '/^ii/{print $2,$3}'
Compare Kernel and Distro Versions
The distro version and kernel version answer different questions.
printf 'kernel=%s arch=%s distro=%s\n' "$(uname -r)" "$(uname -m)" "$(lsb_release -ds)"
See Which Packages Want Updates
Before you upgrade anything, list what would move.
apt list --upgradable
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
Check the Installed and Candidate Package Version
apt policy explains where the next version would come from.
apt policy nginx
next diagnostic step
Where to go from this command
- Boot partition full hub Use for RPM-family kernel inventory.
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.