Lpic 1 Linux Administrator · Free Practice Question Medium

Question 7

Which of the following are valid methods to add a new repository to a Red Hat-based system using the yum package manager?
  • A

    Use yum-config-manager with the --add-repo option.

  • B

    Add a .repo file describing the repository to /etc/yum.repos.d/.

  • C

    Use yum-config-manager with the repository URL (without options).

  • D

    Pass the repository URL to yum with the --add option.

  • E

    Add the repository name directly to yum-config-manager without any options.

Reveal correct answer

Correct answer: A

A.

Using yum-config-manager with the --add-repo option is a valid and recommended method to add a new repository to a Red Hat-based system using the yum package manager. This approach is straightforward and widely used for modern systems.

B.

This is not the recommended method in modern systems. While valid, it involves manually creating files, which is prone to errors and less efficient compared to using yum-config-manager.

C.

This is not a valid method. The yum-config-manager command requires the --add-repo option to properly add a repository.

D.

This is not a valid method. The --add option is not recognized by yum for adding repositories.

E.

This is not a valid method. yum-config-manager requires specific options, such as --add-repo, to function correctly.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need