Courseiva
Linux Installation and Package ManagementmediumMultiple ChoiceObjective-mapped

LPIC-1 Linux Installation and Package Management Practice Question

A technician is tasked with installing a package from a third-party repository on a CentOS 7 system. What is the correct first step to add the repository?

⚠ Common exam trap

Many candidates confuse editing /etc/yum.conf (which is for global yum options, not repository definitions) with the correct method of adding a .repo file, or they assume 'yum localinstall' can add a repository when it only installs a single package.

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

Create a .repo file in /etc/yum.repos.d/.

On CentOS 7, third-party repositories are added by placing a .repo file in /etc/yum.repos.d/. This file defines the repository ID, name, baseurl, and GPG check settings. Yum reads all .repo files in this directory at runtime, making it the standard and correct first step for adding a repository.

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 'yum localinstall' with the repository URL.

    Why it's wrong here

    localinstall is for RPM files, not adding repositories.

  • Create a .repo file in /etc/yum.repos.d/.

    Why this is correct

    Repository definitions are placed in /etc/yum.repos.d/ as .repo files.

  • Edit /etc/yum.conf and add the repository URL.

    Why it's wrong here

    yum.conf holds global settings, not repository definitions.

  • Use 'yum-config-manager --add-repo' without any further steps.

    Why it's wrong here

    While possible, the question asks for the first step; creating a file is the fundamental method.

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 527 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 →

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.