Which of the following repository contents correctly adds a local repo at /etc/yum.repos.d/myrepo.repo with baseurl http://repo.example/pub?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which of the following repository contents correctly adds a local repo at /etc/yum.repos.d/myrepo.repo with baseurl http://repo.example/pub?

Explanation:
A Yum repository is defined in /etc/yum.repos.d as a .repo file containing a section for each repo. Each section starts with a repository ID in square brackets and must include at least a baseurl to point to the location of packages, plus enabled to control whether Yum uses it. The example shown creates a repo named myrepo with a readable description, points baseurl to http://repo.example/pub, enables the repo, and turns off GPG verification for this local source. This combination is what makes the repository usable immediately and clearly identifiable. So the block [myrepo] name=My Repo baseurl=http://repo.example/pub enabled=1 gpgcheck=0 is correct because it provides a repo ID, a descriptive name, the location of the packages, and the on/off and GPG verification settings that control how Yum interacts with that source. If you wanted to enforce signature checks, you would leave gpgcheck to 1 and supply a valid GPG key. The other options fail because they either use an invalid key (repourl), omit important context such as a name, or do not consistently provide the necessary fields to define and enable a usable repository.

A Yum repository is defined in /etc/yum.repos.d as a .repo file containing a section for each repo. Each section starts with a repository ID in square brackets and must include at least a baseurl to point to the location of packages, plus enabled to control whether Yum uses it. The example shown creates a repo named myrepo with a readable description, points baseurl to http://repo.example/pub, enables the repo, and turns off GPG verification for this local source. This combination is what makes the repository usable immediately and clearly identifiable.

So the block

[myrepo]

name=My Repo

baseurl=http://repo.example/pub

enabled=1

gpgcheck=0

is correct because it provides a repo ID, a descriptive name, the location of the packages, and the on/off and GPG verification settings that control how Yum interacts with that source. If you wanted to enforce signature checks, you would leave gpgcheck to 1 and supply a valid GPG key.

The other options fail because they either use an invalid key (repourl), omit important context such as a name, or do not consistently provide the necessary fields to define and enable a usable repository.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy