cancel
Showing results for 
Search instead for 
Did you mean: 
ckowasic
Cadet
Cadet
  • 1,799 Views

RHCSA - Adding repos with dnf config-manager vs manually creating repo file

Jump to solution

I just took the RHCSA yesterday and unfortunately I didn't pass by a couple questions. I was wondering if the dnf config-manager --add-repo would be counted as correct instead of adding the repo file manually?

 

 

Labels (1)
1 Solution

Accepted Solutions
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 1,750 Views

It matters not how you get there, as long as it is done in accordance with the instructions. You must achieve the stated objective, which may include specific settings.

I'll put this in the context of the RH124 class, which covers this topic.

Using just dnf config-manager --add-repo may not result in the desired settings. For example, RH124 lab instructions say this:

On the serverb machine, configure a software repository to obtain updates. Name the repository errata and configure the repository in the /etc/yum.repos.d/errata.repo file. Configure the errata.repo file to use the http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata  repository. Do not verify GPG signatures.

If you were to only use this command, you will not have achieved the objective:

dnf config-manager --add-repo=http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata 

So why doesn't this meet the requirement? Well, for a number of reasons:

> The file name in /etc/yum.repos.d/ will be incorrect. Instead of being named as errata.repo, in accordance with the instructions, it will be named: content.example.com_rhel9.0_x86_64_rhcsa-practice_errata.repo

> The repoID will be incorrect. Intead of [errata], it'll be [content.example.com_rhel9.0_x86_64_rhcsa-practice_errata]

> The name directive may be incorrect (it depends on the instructions). Instead of something like name=Red Hat Updates, it'll be: name=created by dnf config-manager from http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata  

> the command does do anything with this instruction: Do not verify GPG signatures. The following line will be missing: gpgcheck=0

So what do you do? Well, you'd have to rename and edit the repo file.

I like to use dnf config-manager --add-repo to first create the file, then go behind it and rename / edit it to meet the instructions.

Incidentally, will the file still work (assuming no typos un the URL)? Sure it will. However, it won't meet the specific requirements as set forth in the instructions.

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College

View solution in original post

4 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,786 Views

@ckowasic AFAIK, you can use anything available in the exam env and at the end all that matters is you fulfill the objective and the configuration survives reboot. RH exam does not favour any particular method to achieve an objective unless it is specifically and explicitly mentioned in the question.

0 Kudos
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 1,751 Views

It matters not how you get there, as long as it is done in accordance with the instructions. You must achieve the stated objective, which may include specific settings.

I'll put this in the context of the RH124 class, which covers this topic.

Using just dnf config-manager --add-repo may not result in the desired settings. For example, RH124 lab instructions say this:

On the serverb machine, configure a software repository to obtain updates. Name the repository errata and configure the repository in the /etc/yum.repos.d/errata.repo file. Configure the errata.repo file to use the http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata  repository. Do not verify GPG signatures.

If you were to only use this command, you will not have achieved the objective:

dnf config-manager --add-repo=http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata 

So why doesn't this meet the requirement? Well, for a number of reasons:

> The file name in /etc/yum.repos.d/ will be incorrect. Instead of being named as errata.repo, in accordance with the instructions, it will be named: content.example.com_rhel9.0_x86_64_rhcsa-practice_errata.repo

> The repoID will be incorrect. Intead of [errata], it'll be [content.example.com_rhel9.0_x86_64_rhcsa-practice_errata]

> The name directive may be incorrect (it depends on the instructions). Instead of something like name=Red Hat Updates, it'll be: name=created by dnf config-manager from http://content.example.com/rhel9.0/x86_64/rhcsa-practice/errata  

> the command does do anything with this instruction: Do not verify GPG signatures. The following line will be missing: gpgcheck=0

So what do you do? Well, you'd have to rename and edit the repo file.

I like to use dnf config-manager --add-repo to first create the file, then go behind it and rename / edit it to meet the instructions.

Incidentally, will the file still work (assuming no typos un the URL)? Sure it will. However, it won't meet the specific requirements as set forth in the instructions.

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
ckowasic
Cadet
Cadet
  • 1,738 Views
Thank you for the detailed response. Thats helps a lot!
0 Kudos
FEDECW
Mission Specialist
Mission Specialist
  • 403 Views

http://content.example.com/rhel9.3/x86_64/rhcsa-practice/errata
url error
Errata Updates 14 kB/s | 196 B 00:00
Errors during downloading metadata for repository 'errata':
- Status code: 404 for http://content.example.com/rhel9.3/x86_64/rhcsa-practice/errata/repodata/repomd.xml (IP: 172.25.254.254)
Error: Failed to download metadata for repo 'errata': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

0 Kudos
Join the discussion
You must log in to join this conversation.