LPIC-1 Linux Installation and Package Management Practice Question
A junior administrator needs to install the package 'nginx' on a Debian 12 server, but the required package file is not available in any configured APT repository. The administrator has downloaded the file 'nginx_1.22.1-9_amd64.deb' to the current directory. Which command should be used to install this local package file while automatically resolving and installing any missing dependencies from the configured repositories?
⚠ Common exam trap
The trap here is assuming that dpkg -i is the standard way to install local .deb files, when in fact modern APT can handle local files directly with automatic dependency resolution.
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 install ./nginx_1.22.1-9_amd64.deb
The apt command can install a local .deb file when given a path that includes a slash (such as ./filename.deb), and it automatically resolves and installs dependencies from configured repositories. This combines the local installation capability of dpkg with the dependency resolution of APT in a single step. The other commands either fail to resolve dependencies, misinterpret the filename as a package name, or force installation while leaving dependencies broken.
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 install ./nginx_1.22.1-9_amd64.deb
Why this is correct
On Debian 12, apt accepts a local .deb file path (with ./ to distinguish it from a package name) and installs it while automatically resolving and downloading any missing dependencies from the configured repositories. This is the modern replacement for the older gdebi or dpkg followed by apt-get install -f approach, and it performs the entire operation in one step as required.
- ✗
apt-get install nginx_1.22.1-9_amd64.deb
Why it's wrong here
apt-get install expects package names from repositories, not local file paths. When given a filename, it interprets it as a package name and fails with 'Unable to locate package'. The correct syntax requires a path (e.g., ./nginx_1.22.1-9_amd64.deb) and the apt command, not apt-get, to handle local .deb files with automatic dependency resolution.
- ✗
dpkg -i nginx_1.22.1-9_amd64.deb
Why it's wrong here
The dpkg -i command installs a local .deb file but does not resolve dependencies automatically. If nginx depends on packages not already installed, dpkg will leave the package in an unconfigured state and report unmet dependencies. The administrator would then need to run apt-get install -f to fix them, making this a two-step process rather than the single command that resolves dependencies automatically.
- ✗
dpkg --install --force-depends nginx_1.22.1-9_amd64.deb
Why it's wrong here
Using --force-depends with dpkg installs the package even if dependencies are missing, but this leaves the system in a broken state with unmet dependencies. It does not resolve or install the missing packages from repositories. This option ignores the problem rather than solving it, and can cause nginx to fail at runtime or prevent other packages from being configured properly.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 402 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 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.