Courseiva

LPIC-1 Linux Installation and Package Management Practice Question

A technician needs to remove a package named 'apache2' along with its configuration files from a Debian system. Which command should be used?

⚠ Common exam trap

A common mix-up: candidates confuse 'apt-get remove' with 'apt-get purge', mistakenly thinking 'remove' also deletes configuration files, or they incorrectly assume 'dpkg -r' performs a purge, when in fact it only removes the package without configuration cleanup.

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-get purge apache2

The 'apt-get purge' command removes the specified package along with its configuration files from a Debian system. Unlike 'remove', which leaves configuration files intact, 'purge' deletes both the package binaries and the associated configuration data from /etc and other locations, fulfilling the requirement to remove 'apache2' completely.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    dpkg -r apache2

    Why it's wrong here

    dpkg -r removes the package but leaves its configuration files on disk, so the stated requirement is unmet. It is tempting because dpkg operates directly on the local package database, yet it would be correct when you intend to reinstall later and want existing configuration preserved.

  • ✗

    apt-get autoremove apache2

    Why it's wrong here

    autoremove deletes packages that were installed automatically as dependencies and are no longer needed; it does not purge apache2's configuration files. It is tempting as a cleanup command, yet it would be correct after removing a package to clear orphaned dependencies no longer required by anything.

  • ✓

    apt-get purge apache2

    Why this is correct

    `apt-get purge apache2` removes both the package and its configuration files, satisfying the stem's explicit requirement to delete configuration alongside the package. Unlike `remove`, which leaves conffiles on disk, `purge` deletes them, so no residual settings remain on the Debian system.

  • ✗

    apt-get remove apache2

    Why it's wrong here

    apt-get remove uninstalls the package binaries but retains configuration files, contradicting the purge requirement. It is tempting because it resolves dependencies cleanly, yet it would be correct when you want the package gone while keeping its configuration for a future reinstall.

About these practice questions

This LPIC-1 question is part of Courseiva's 402-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.