LPIC-1 Linux Installation and Package Management Practice Question
Exhibit
Refer to the exhibit. ``` $ cat /etc/yum.repos.d/custom.repo [custom] name=Custom Repository baseurl=http://repo.example.com/centos/$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://repo.example.com/RPM-GPG-KEY-custom ``` $ yum repolist repo id repo name status custom Custom Repository 0
Based on the exhibit, the 'custom' repository shows 0 packages. What is the most likely cause?
⚠ Common exam trap
A common mix-up: candidates assume 'enabled=1' is mandatory or that GPG key issues cause repositories to be ignored, but the real culprit is variable expansion failure, which silently yields an empty package list without error messages.
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 $releasever or $basearch variables are not expanding correctly, leading to an invalid URL
The 'custom' repository shows 0 packages because the $releasever or $basearch variables are not expanding correctly, resulting in an invalid or unreachable repository URL. Yum uses these variables to dynamically construct the baseurl, and if they are undefined or incorrect (e.g., due to a missing or misconfigured /etc/yum/vars/ directory or incorrect release version), the repository metadata cannot be downloaded, so yum reports 0 packages available.
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 repository is disabled because 'enabled=1' is missing
Why it's wrong here
A missing 'enabled=1' line does not disable a repository; DNF/YUM treats absent 'enabled' as enabled by default, so zero packages points elsewhere, such as an empty or unreachable baseurl. The directive is genuinely used to switch a repo off, but only when explicitly set to 'enabled=0'.
- ✓
The $releasever or $basearch variables are not expanding correctly, leading to an invalid URL
Why this is correct
DNF substitutes $releasever and $basearch at runtime when constructing repository URLs. If either variable fails to expand, the resulting baseurl points to a non-existent path, so metadata retrieval returns nothing and the repository reports zero packages despite being enabled.
- ✗
The GPG key is missing, causing yum to ignore the repository
Why it's wrong here
A missing GPG key blocks package installation with a signature error, but yum still lists repository metadata and package counts; it does not silently report zero packages. GPG keys matter when enabling a signed third-party repository and installs fail verification. Here the empty count points to a metadata or baseurl problem instead.
- ✗
The repository metadata is corrupt and needs to be regenerated
Why it's wrong here
Corrupt metadata would typically produce checksum or GPG errors during refresh, not a clean zero-package count. Regenerating metadata (createrepo_c) is the right fix when a repository's repodata is stale or damaged but the configuration itself is valid. Here the empty count points to a misconfigured baseurl or disabled repository instead.
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 402 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.