Courseiva

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

    The linux-headers package matching the running kernel via uname -r supplies the exact header files and build scripts the module's make process requires. Installing headers for a different kernel version would not resolve the missing-header compilation failure.

  • ✗

    `kernel-headers-generic`

    Why it's wrong here

    `kernel-headers-generic` is a Fedora/RHEL package name, so it does not exist in Debian's repositories; Debian ships headers as `linux-headers-$(uname -r)`. It is tempting because it genuinely provides kernel headers for building modules, and would be the correct install on a Fedora or RHEL system.

  • ✗

    `build-essential`

    Why it's wrong here

    `build-essential` pulls in gcc, make and libc development files, but not the kernel headers themselves; Debian ships those separately as `linux-headers-$(uname -r)`. It is tempting because it is the standard package for compiling userspace software, and would be the right choice when a program's build fails for want of a C compiler.

  • ✗

    `linux-kernel-headers`

    Why it's wrong here

    `linux-kernel-headers` is a legacy transitional package that no longer supplies the headers matching the running kernel; on modern Debian, `linux-headers-$(uname -r)` provides the correct build tree. It is tempting because the name literally says "kernel headers", and it was the right package on very old Debian releases before the per-version naming scheme was introduced.

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 402 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 →

How Courseiva writes practice questions · Editorial policy

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.