LPIC-1 Linux Installation and Package Management Practice Question
A Linux administrator is troubleshooting a package dependency issue. When attempting to install package 'foo', the package manager reports a missing dependency 'libbar.so.2'. Which of the following is the most appropriate next step?
⚠ Common exam trap
Candidates often confuse 'ldconfig' (which only updates the cache for already-installed libraries) with a tool that can resolve missing dependencies, or they may think that forcing installation with '--force' is an acceptable workaround, when in fact it bypasses safety checks and can lead to system instability.
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
✓
Use 'apt-file search libbar.so.2' or 'dnf provides libbar.so.2' to find the package that contains the file
The error indicates that the file 'libbar.so.2' is missing from the system. The most appropriate next step is to identify which package provides this file, so that it can be installed to satisfy the dependency. On Debian-based systems, 'apt-file search' queries the package repository metadata to find the package containing a specific file; on Red Hat-based systems, 'dnf provides' performs the same function. This targeted search is the correct first troubleshooting step before any installation or library cache update.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Run 'ldconfig' to update the library cache
Why it's wrong here
ldconfig does not install missing libraries.
- ✗
Reinstall the 'foo' package using 'rpm -i --force foo.rpm'
Why it's wrong here
Force install may break the system.
- ✗
Run 'rpm -q --whatrequires libbar.so.2'
Why it's wrong here
Shows packages requiring the library, not providing it.
- ✓
Use 'apt-file search libbar.so.2' or 'dnf provides libbar.so.2' to find the package that contains the file
Why this is correct
Identifies the package providing the missing library.
Go deeper
Related to this question
About these practice questions
One of 527 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 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.