LPIC-1 Linux Installation and Package Management Practice Question
A system administrator needs to determine which package owns the file /usr/bin/htop on a Debian-based system. Which command will provide this information?
⚠ Common exam trap
Watch out — candidates often confuse the -S (search) and -L (list) options of dpkg, or using apt-file which queries repositories rather than installed packages.
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 -S /usr/bin/htop
The dpkg -S command is used to find the package that owns a specific file on a Debian-based system. It searches the dpkg database of installed packages. The other commands either list files of a package, search repository contents, or search package descriptions, none of which directly answer the question for an installed file.
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-file search /usr/bin/htop
Why it's wrong here
The apt-file search command searches for files within packages available in the repositories, not necessarily installed packages. It requires the apt-file package and an updated database. While it can find which package provides a file, it is not the primary tool for querying installed packages; dpkg -S is more direct and does not require additional setup.
- ✗
dpkg -L /usr/bin/htop
Why it's wrong here
The dpkg -L command lists the files installed by a specified package. It requires a package name as an argument, not a file path. Using it with a file path will result in an error because dpkg expects a package name. To find the package owning a file, dpkg -S is used instead.
- ✓
dpkg -S /usr/bin/htop
Why this is correct
The dpkg -S command searches for the package that owns a specified file. It queries the dpkg database for installed packages and returns the package name that contains the given file path. This is the correct tool for identifying package ownership on Debian-based systems.
- ✗
apt-cache search /usr/bin/htop
Why it's wrong here
The apt-cache search command searches package names and descriptions for a given keyword. It does not search for file paths. Using a file path as a keyword may return unrelated results or nothing. It is not suitable for determining which package owns a specific file.
Go deeper
Related to this question
About these practice questions
One of 402 original LPIC-1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.