LPIC-1 Linux Installation and Package Management Practice Question
A developer downloads the source code for a kernel module and attempts to compile it using `make`. The compilation fails with an error indicating that the kernel header files are missing. Which package should be installed to provide the necessary headers on a Debian system?
⚠ Common exam trap
A common mix-up: candidates confuse the generic 'build-essential' meta-package (which is needed for compiling any C code) with the kernel-specific headers package, or they assume a generic package name like 'kernel-headers-generic' exists on Debian, when in fact Debian uses version-specific `linux-headers-*` packages and the `-generic` flavor is Ubuntu-specific.
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
✓
`linux-headers-$(uname -r)`
The correct package is `linux-headers-$(uname -r)` because kernel modules must be compiled against headers that match the exact running kernel version. The `$(uname -r)` command substitution dynamically inserts the current kernel release string (e.g., `5.10.0-28-amd64`), ensuring the headers correspond to the active kernel. On Debian, these headers are provided by the `linux-headers-<version>` package, which includes the necessary `Kbuild`, `Kconfig`, and header files under `/usr/src/linux-headers-<version>`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
`linux-headers-$(uname -r)`
Why this is correct
Provides headers for the running kernel.
- ✗
`kernel-headers-generic`
Why it's wrong here
This package name is not valid on Debian.
- ✗
`build-essential`
Why it's wrong here
Provides compilers but not kernel headers.
- ✗
`linux-kernel-headers`
Why it's wrong here
No such package exists.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 527 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.