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 server. Which command should the administrator use?
⚠ Common exam trap
It's easy for candidates to confuse dpkg -L (list files of a package) with dpkg -S (search for package owning a file), as both deal with file-package relationships but in opposite directions.
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 correct command is dpkg -S, which searches the dpkg database for the package that owns a given file. This is the standard method on Debian-based systems to map a file to its package. The other options either list files from a known package, search repository indexes, or are for a different package management system.
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
apt-file search looks for files in packages available in repositories, not necessarily installed packages. It may not find files from locally installed packages or may return multiple results. It is not the direct method to query the installed package database for ownership.
- ✗
dpkg -L htop
Why it's wrong here
dpkg -L lists all files installed by the htop package, but it does not identify which package owns a specific file. It requires the package name as an argument, so it cannot be used to find the owner of /usr/bin/htop without already knowing the package.
- ✓
dpkg -S /usr/bin/htop
Why this is correct
dpkg -S (or --search) searches the installed packages database for the package that owns the specified file. It directly answers the question by returning the package name that contains /usr/bin/htop, making it the correct and efficient tool for this task.
- ✗
rpm -qf /usr/bin/htop
Why it's wrong here
rpm -qf is the equivalent command on RPM-based systems like Red Hat or Fedora. On a Debian-based system, rpm is not the native package manager and may not be installed or have an accurate database. Thus, it is incorrect for this scenario.
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 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.