skip to Main Content

I am trying to configure my yum repo on my centos7 machine to install packages only from my internal repository. To do that, I have done following changes:

  1. Moved all the current repo configurations to different location:

    sudo mv /etc/yum.repos.d/*.repo ~/backup_yum_repos/

  2. Create a new file Mycompany-internals.repo under /etc/yum.repos.d

  3. Added following contents to it:

[Mycompany-internals]
name=Mycompany-internals
baseurl=http://linux-repo.my-company.com/abc-2021q2-sr/CentOS-$releasever-$basearch/RPMS.all/
baseurl=http://linux-repo.my-company.com/epel/abc-2021q2-sr/epel/epel
baseurl=http://linux-repo.my-company.com/epel/abc-2021q2-sr/epel/epel-debuginfo/
baseurl=http://linux-repo.my-company.com/epel/abc-2021q2-sr/epel/epel-source/
baseurl=https://linux-repo.my-company.com/utilities/avamar/CentOS$releasever/
baseurl=https://linux-repo.my-company.com/utilities/splunk/v8/
baseurl=http://linux-repo.my-company.com/utilities/perforce/perforce
baseurl=http://linux-repo.my-company.com/utilities/docker/docker/
enabled=1
gpgcheck=0


Now, I expect a normal yum installation to work using my registry mentioned above.

But when I run yum install docker (for example), it fails with error:

Loaded plugins: changelog, fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
My-company-internal                                                                                                              | 2.5 kB  00:00:00     
My-Company-internal/primary_db                                                                                                   |  42 kB  00:00:00     
No package docker available.
Error: Nothing to do

2

Answers


  1. Which version is your yum?, there is a bug where yum will recognize the first URL and ignore the rest, this has been fixed in version yum-3.4.3-159.el7.

    Login or Signup to reply.
  2. You are using baseurl= statement multiple times which is bad, below is a quote from yum.conf man page:

                  baseurl Must be a URL to the directory where the yum repository's `repodata' directory lives. Can be an http://, ftp://  or
                  file:// URL. You can specify multiple URLs in one baseurl statement. The best way to do this is like this:
                  [repositoryid]
                  name=Some name for this repository
                  baseurl=url://server1/path/to/repository/
                          url://server2/path/to/repository/
                          url://server3/path/to/repository/
    
                  If  you  list  more than one baseurl= statement in a repository you will find yum will ignore the earlier ones and probably
                  act bizarrely. Don't do this, you've been warned.
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search