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:
-
Moved all the current repo configurations to different location:
sudo mv /etc/yum.repos.d/*.repo ~/backup_yum_repos/
-
Create a new file
Mycompany-internals.repo
under /etc/yum.repos.d -
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
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.
You are using baseurl= statement multiple times which is bad, below is a quote from yum.conf man page: