Courseiva

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 rebuilds the dynamic linker cache from libraries already present on disk; it cannot supply the absent libbar.so.2 file. It is tempting because it resolves 'library not found' runtime errors, but it would be correct after installing the missing library, not when the package manager reports an unsatisfied dependency.

  • ✗

    Reinstall the 'foo' package using 'rpm -i --force foo.rpm'

    Why it's wrong here

    Forcing installation with rpm -i --force bypasses dependency checks, leaving foo installed but broken because libbar.so.2 remains absent. It is tempting to silence the error, but it would be correct only when overwriting files from an already-satisfied package, not when a genuine dependency is missing.

  • ✗

    Run 'rpm -q --whatrequires libbar.so.2'

    Why it's wrong here

    rpm -q --whatrequires lists packages depending on libbar.so.2; it identifies consumers rather than locating or installing the provider. It is tempting as a diagnostic query, but it would be correct when assessing the impact of removing a library, not when resolving a missing dependency blocking installation.

  • ✓

    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

    The missing dependency is a shared library file, not a package name, so the package manager cannot resolve it directly. Querying which package provides libbar.so.2 identifies the correct RPM or DEB to install, satisfying the dependency.

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 →

How Courseiva writes practice questions · Editorial policy

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.