6

No, this is not a duplicate of disable YUM mirrorlist checking That question was solved by preventing update of all metadata. This is not what I want to do.

I am trying to build images behind a corporate firewall which restricts outside access. I have internal mirrors, to which I point the installer during kickstart. That part works. Image reboots. I have disabled all repos (even tried deleting the existing .repo files), and laid down a custom repo file pointing to our internal mirrors. I've put "enabled = 0" in the fastestmirror.conf file (verified it works, yum doesn't say it's loading the plugin any more), BUT I'm still getting this error, and yum bails out:

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#7 - "Failed to connect to 2604:1580:fe02:2::10: Network is unreachable"

Well, yes, I know it is...that's why I disabled fastest mirror. I don't use the mirror list any more, because I've disabled all default repos.

I don't want to disable caching of metadata (nor do I want to extend its life, as was done in the above solution): I want metadata from our repos to be retrieved, but I don't want it to try to access the mirror list; there is no need.

Why is it still trying to access the mirror list? How can I disable that?

4
  • Have you tried running yum clean all and rm -rf /var/cache/yum? Commented Nov 21, 2018 at 0:51
  • Yes I have. Ran that after deleting the .repo files. Commented Nov 21, 2018 at 0:58
  • 1
    Very duct-tape-ish but have you considered redirecting DNS for mirrorlist.centos.org and pointing it to a local-to-you machine and have it serve up a list of your mirror(s)? Commented Nov 21, 2018 at 2:20
  • 1
    Redirecting DNS would do the same thing as editing the file as I suggested below! Commented Nov 21, 2018 at 2:44

2 Answers 2

2

I think this article will solve your issue here is the most relevant part first:

This should be where the mirror is:

baseurl=file:/share/CentOS/$releasever/os/$basearch/ 

If you want it not to look at all:

  • Comment out the repo's
  • Remove the baseurl's
  • Move the whole file to a .bak version and delete the original.

Set up /etc/yum.repos.d/CentOS-Base.repo like:

[base] name=CentOS-$releasever - Base baseurl=file:/share/CentOS/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 protect=1 priority=1 enabled=1 [updates] name=CentOS-$releasever - Updates baseurl=file:/share/CentOS/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 protect=1 priority=1 enabled=1 [extras] name=CentOS-$releasever - Extras baseurl=file:/share/CentOS/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 protect=1 priority=1 enabled=1 [centosplus] name=CentOS-$releasever - Plus baseurl=file:/share/CentOS/$releasever/centosplus/$basearch/ exclude=kernel* gpgcheck=1 enabled=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 protect=0 priority=1 [contrib] name=CentOS-$releasever - Contrib baseurl=file:/share/CentOS/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 protect=0 priority=3 

From Here: https://wiki.centos.org/HowTos/CreateLocalMirror

2
  • He doesn't want to make a mirror (he's done that apparently) he wants yum to stop checking the list of available mirrors. Even blocking on a network level will generate his error. Commented Nov 21, 2018 at 2:19
  • 1
    Then comment out the repos in that file. Like #[contrib] or remove the base url... @ivanivan Commented Nov 21, 2018 at 2:25
1

In the files in /etc/yum.repo.d/*.repo , use baseurl instead of mirrorlist.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.