Configuring a Third Party Repository

 

Configuring a Third Party Repository

There are two ways to configure a third-part repository, either manually or through yum-config-manager

1) Yum-config-manager option

  a) Yum-config-manager –add-repo=ADDREPO [add (and enable) the repo from the  specified file or url]

  yum-config-manager  --add-repo=http://dl.fedoraproject.org/pub/epel/7/x86_64/

  b) The yum configured third party repository will be configured in /etc/yum.repos.d file

  c) It is generally important to download the GPG key; so do cd /etc/pki/rpm-gpg;

  wget https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

  d) Then you would edit the /etc/yum.repos.d/fedoraproject.repo and edit the last two lines, the yum-config-manager adds the rest of the lines manually

[dl.fedoraproject.org_pub_epel_7_x86_64_]

name=added from: http://dl.fedoraproject.org/pub/epel/7/x86_64/

baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/

enabled=1

[the below two lines you would need to add to the configuration after yum-config-manager command

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

 

2) Manually configuring the repo configuration

a) You would download the gpgkey from step 1 c) and then you would create the entire file in step (1-d) from scratch without any commands

3) Please note that you can disable a repo with the command yum-config-manager –disable [name of repo] but you can only remove a repo from the server by removing the file located in /etc/yum/repos.d