LPIC-1 Linux Installation and Package Management Practice Question
When troubleshooting a problem with a Debian package installation, an administrator wants to see which version of a package would be installed from the configured repositories. Which command displays the candidate version?
⚠ Common exam trap
Candidates often confuse `apt-get -s install` (a simulation) with the dedicated `apt-cache policy` command for querying the candidate version, or they mistakenly think `dpkg -l` or `apt-show-versions` provide repository-level candidate information.
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-cache policy package
The `apt-cache policy package` command displays the package's priority, the installed version (if any), and the candidate version (the version that would be installed by default from the configured repositories). This makes it the correct tool for determining which version will be installed from the repositories.
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 -l package
Why it's wrong here
dpkg -l lists installed packages and their versions from the local dpkg database, ignoring configured repositories entirely. It is tempting because it reports versions, but it shows what is installed, not the candidate available for upgrade; apt-cache policy or apt list displays the candidate.
- ✗
apt-show-versions package
Why it's wrong here
apt-show-versions reports installed versions and their distribution status, not the candidate version a repository would supply. It is tempting because it queries APT metadata, but it answers which release a package came from; apt-cache policy or apt list --upgradable shows the candidate.
- ✗
apt-get -s install package
Why it's wrong here
apt-get -s install simulates installation, showing what would be fetched and changed, but its output does not cleanly present the candidate version field. It is tempting because -s previews actions, yet apt-cache policy or apt list explicitly reports the candidate version from configured repositories.
- ✓
apt-cache policy package
Why this is correct
apt-cache policy queries the APT cache and prints, for each configured repository, the installed version and the candidate version that would be selected for installation, letting the administrator confirm which version the repositories currently offer.
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 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.