LPIC-1 Linux Installation and Package Management Practice Question
Which two commands can be used to list all packages that have the string 'kernel' in their name on a Debian system? (Choose two.)
⚠ Common exam trap
Watch out — candidates often confuse `dpkg --get-selections` (which lists all packages with their selection state, not just installed ones) with `dpkg -l` (which lists installed packages with a glob filter), or they mistakenly apply RPM-based commands like `rpm -qa` to a Debian system.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
`apt list --installed '*kernel*'`
`apt list --installed '*kernel*'` uses the APT package manager to list all installed packages whose names match the glob pattern `*kernel*`. Option B is correct because `dpkg -l '*kernel*'` uses the dpkg low-level tool with the `-l` (list) flag and a glob pattern to display all packages whose names contain 'kernel'. Both commands directly filter by package name on a Debian system.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
`apt list --installed '*kernel*'`
Why this is correct
Lists installed packages matching the pattern.
- ✓
`dpkg -l '*kernel*'`
Why this is correct
Lists packages matching the pattern.
- ✗
`dpkg --get-selections | grep kernel`
Why it's wrong here
Lists all packages, but grep may match package status lines too, not solely names.
- ✗
`apt-cache search kernel`
Why it's wrong here
Searches descriptions and names, not just installed packages.
- ✗
`rpm -qa | grep kernel`
Why it's wrong here
RPM is not used on Debian.
Go deeper
Related to this question
About these practice questions
One of 527 original LPIC-1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.