LPIC-1 Linux Installation and Package Management Practice Question
A systems administrator downloads a .deb package file but it fails to install due to unmet dependencies. Which command sequence should be used to resolve the dependencies and complete the installation?
⚠ Common exam trap
Test-takers frequently assume `apt-get install -f` alone can install the .deb package, but it only fixes dependencies and does not process the original .deb file, so the package must first be installed (even partially) with `dpkg -i`.
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
✓
dpkg -i package.deb; apt-get install -f
When a .deb package fails to install due to unmet dependencies, `dpkg -i package.deb` installs the package but leaves dependencies unresolved. Running `apt-get install -f` (or `apt install -f`) then fixes broken dependencies by downloading and installing any missing packages from the configured repositories. This two-step sequence is the standard method for resolving dependency issues after a direct dpkg installation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
apt-get install -f
Why it's wrong here
apt-get install -f repairs broken dependencies for packages already recorded in dpkg's database, but it does not install a newly downloaded .deb that was never added. It is tempting because it is the standard dependency-fix command; the correct sequence first installs the file with dpkg -i, then runs this repair.
- ✓
dpkg -i package.deb; apt-get install -f
Why this is correct
`dpkg -i` installs the local .deb but leaves dependencies unresolved, so `apt-get install -f` then reads the package database, fetches the missing dependencies from configured repositories and configures everything. This two-step sequence satisfies the stem's unmet-dependency constraint, which `dpkg` alone cannot fix.
- ✗
dpkg --configure -a
Why it's wrong here
dpkg --configure -a only finishes configuring packages already unpacked but left unconfigured; it resolves no missing dependency and never installs the downloaded .deb. It is tempting because it repairs interrupted dpkg operations, and would be correct after an install aborted mid-configuration.
- ✗
apt-get upgrade
Why it's wrong here
apt-get upgrade only installs newer versions of already-installed packages; it never fetches a downloaded .deb or its missing dependencies. It is tempting because it updates existing packages, which is its actual purpose, but resolving a local file's unmet dependencies requires apt-get install -f or gdebi.
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 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.