LPIC-1 Linux Installation and Package Management Practice Question
A system administrator needs to find out which package installed the file /usr/bin/foo on a Red Hat system. Which command should be used?
⚠ Common exam trap
Many candidates confuse the direction of the query: candidates often pick `rpm -ql` (list files in a package) instead of `rpm -qf` (find package owning a file), because they misremember which option performs the reverse lookup.
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
✓
`rpm -qf /usr/bin/foo`
The `rpm -qf /usr/bin/foo` command queries the RPM database to determine which installed package owns the specified file. The `-f` (or `--file`) option tells RPM to search for the package that provided that file path, making it the correct choice for this task on a Red Hat 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.
- ✗
`rpm -qa /usr/bin/foo`
Why it's wrong here
Lists all packages, does not take a file path.
- ✗
`rpm -qi /usr/bin/foo`
Why it's wrong here
Shows info about a package, not owner.
- ✗
`rpm -ql /usr/bin/foo`
Why it's wrong here
Lists files in a package, not the owner.
- ✓
`rpm -qf /usr/bin/foo`
Why this is correct
Queries the package that owns the file.
Go deeper
Related to this question
About these practice questions
This LPIC-1 question is part of Courseiva's 527-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.