LPIC-1 Linux Installation and Package Management Practice Question
An administrator wants to remove a package 'apache2' but keep its configuration files on the system. Which command should be used?
⚠ Common exam trap
Many exam-takers confuse `purge` (which removes configs) with `remove` (which keeps configs), or mistakenly think `autoremove` can target a specific package, when it only cleans orphaned dependencies.
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 remove apache2`
`apt-get remove apache2` removes the package binaries but leaves the configuration files (under /etc/apache2/) intact. This is the standard behavior of the `remove` subcommand in APT and dpkg, allowing the administrator to reinstall the package later with the same settings.
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 --purge apache2`
Why it's wrong here
Purge removes configuration files.
- ✗
`apt-get purge apache2`
Why it's wrong here
Purge removes configuration files as well.
- ✗
`apt-get autoremove apache2`
Why it's wrong here
Autoremove removes automatically installed dependencies, not the specified package.
- ✓
`apt-get remove apache2`
Why this is correct
Removes the package but keeps configuration files.
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.