Courseiva

LPIC-1 Linux Installation and Package Management Practice Question

After a failed package upgrade, a Debian system shows 'unmet dependencies' when trying to install any new software. What is the most appropriate command to fix this condition?

⚠ Common exam trap

Many candidates think manually editing the dpkg database (option A) is a quick fix, but LPIC-1 tests the understanding that APT's built-in repair mechanism is the correct and safe approach, not low-level manual manipulation.

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 install -f

The 'apt-get install -f' command (option B) is the correct fix because it invokes the '--fix-broken' option, which automatically resolves unmet dependencies by either installing missing packages or removing partially installed ones. This is the standard Debian/APT tool for repairing a broken package state after a failed upgrade, as it reads the dpkg database and corrects inconsistencies without manual intervention.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Edit /var/lib/dpkg/status manually

    Why it's wrong here

    Hand-editing /var/lib/dpkg/status corrupts the package database's internal consistency and does not recompute dependency relationships. It tempts because the file lists package states, so editing appears to fix them, but apt-get -f install is designed to reconcile dependencies safely through the package manager.

  • ✓

    apt-get install -f

    Why this is correct

    `apt-get install -f` invokes APT's dependency repair, scanning the dpkg database for broken or unmet dependencies and attempting to configure or remove offending packages. This directly resolves the stem's "unmet dependencies" state, restoring a consistent package set so subsequent installs succeed.

  • ✗

    dpkg --purge $(dpkg -l | grep ^iU | awk '{print $2}')

    Why it's wrong here

    Removing all partially installed packages is not a standard fix and may remove needed software.

  • ✗

    dpkg --force-depends -i *.deb

    Why it's wrong here

    Forcing dpkg to install with --force-depends bypasses dependency checks, leaving the system in a worse inconsistent state rather than repairing it. It tempts because it makes installation proceed, which is correct only when deliberately installing a package whose dependencies are knowingly satisfied elsewhere.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

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.