LFCS Essential Commands Practice Question
A system administrator is managing a production web server running CentOS 7. The server hosts a critical application that depends on the 'httpd' package. Recently, the administrator attempted to install an updated version of httpd using 'yum update httpd', but the update failed with a dependency error: 'Error: Package: httpd-2.4.6-97.el7.centos.x86_64 requires libapr-1.so.0()(64bit)'. The administrator verifies that the apr package is installed (apr-1.5.2-6.el7.x86_64) and that the required library file exists at /usr/lib64/libapr-1.so.0. Despite this, yum continues to fail with the same error. After checking the yum repository configuration, the administrator notices that the base repository lists 'mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os' and the 'baseurl' is commented out. The system's /etc/yum.conf has 'keepcache=1'. What is the most likely cause of the dependency error, and which command should the administrator run to resolve it?
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
✓
The repository metadata is stale; run 'yum clean all' then 'yum update'.
The dependency error persists despite the library being present because yum's metadata is stale. Running 'yum clean all' clears the local cache, forcing yum to download fresh metadata from the repository, which resolves the false dependency conflict. Option C is correct. Option A is not necessary as 'yum clean all' handles cache clearing properly. Option B bypasses dependency checks and is unsafe. Option D is incorrect because the installed apr version does provide the required library.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The yum cache is corrupted; delete /var/cache/yum manually and run 'yum makecache'.
Why it's wrong here
While corruption could cause issues, 'yum clean all' is the standard and safer approach.
- ✗
The dependency is satisfied but yum's dependency resolver has a bug; use 'rpm -Uvh httpd.rpm --nodeps' to bypass dependency check.
Why it's wrong here
Bypassing dependencies is dangerous and not a correct resolution.
- ✓
The repository metadata is stale; run 'yum clean all' then 'yum update'.
Why this is correct
Cleaning metadata refreshes dependency resolution, likely resolving the false error.
- ✗
The installed apr package is from a different version than what httpd expects; install a newer apr from a different repository.
Why it's wrong here
The installed apr provides the required library; version mismatch is unlikely.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 507 original LFCS 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.