LPIC-1 Linux Installation and Package Management Practice Question
A dependency analysis shows that removing package 'libfoo' will also remove 'appA' and 'appB' because they depend on libfoo. The administrator wants to remove libfoo but keep appA and appB. What is the best approach?
⚠ Common exam trap
LPIC-1 often tests the temptation to use --force flags to bypass dependency errors — candidates must recognize that forcing removal breaks dependent applications and that the correct approach preserves functionality via a compatible replacement.
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
✓
Check if a compatible alternative package exists and install it, then remove libfoo.
The best approach is to find a compatible alternative package that provides the same functionality as libfoo, install it, and then remove libfoo. This satisfies the dependency requirements of appA and appB through the replacement package, allowing libfoo to be removed without breaking the dependent applications. This is the standard, non-destructive way to resolve dependency conflicts on Debian-based systems.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Force removal of libfoo using `dpkg --force-depends`.
Why it's wrong here
`dpkg --force-depends` removes libfoo while leaving appA and appB installed but with unmet shared-library dependencies, so they fail to launch. It is tempting because dpkg's force flags are the correct tool when a package must be removed despite a broken dependency chain during emergency repair, but here the administrator needs the applications to keep working.
- ✗
Recompile appA and appB without the dependency on libfoo.
Why it's wrong here
Recompiling appA and appB against a replacement library changes the applications themselves, not the package dependency graph, and leaves apt still recording a dependency on libfoo. It is tempting because rebuilding from source is the correct route when upstream code must link against a different library version, but the scenario asks only to remove libfoo while retaining the installed binaries.
- ✓
Check if a compatible alternative package exists and install it, then remove libfoo.
Why this is correct
Installing a compatible alternative satisfies the dependency without removing libfoo's dependants, since the package manager resolves appA and appB against the replacement. This preserves both applications while allowing libfoo's removal, meeting the administrator's stated constraint.
- ✗
Use `apt-get remove libfoo --no-dep`
Why it's wrong here
`--no-dep` is not a valid apt-get option, so the command fails outright rather than preserving dependants. It is tempting because apt does offer dependency-handling flags such as `--no-install-recommends`, which suppress optional packages; here the requirement is to keep appA and appB installed while removing libfoo, which apt cannot satisfy without breaking their declared dependencies.
Visual reference
Go deeper
Related to this question
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 →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official LPI exam blueprint
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.