How To Remove Non-Existent/Phantom Yum Repository

oraclerhel7yum

TL;DR… I'm replacing public yum repos with an internal one and I can't figure out why two public ones continue to display in "yum repolist" when they don't appear in the normal config files.

I've installed Oracle Linux 7.1 (closely derived from RHEL 7.1) and am switching the system's yum repositories from the public repos to our internal private one.

Oracle Linux 7.1 ships with a default /etc/yum.repos.d/public-yum-ol7.repo which contains several repos, the only two which are enabled are "ol7_latest" and "ol7_UEKR3" which come from public-yum.oracle.com.

I delete this file and copy my own own .repo files… uswulnrepo01_ol7_latest.repo and uswulnrepo01_ol7_uekr3.repo. (uswulnrepo01 is our internal yum repository).

After I do this I verify with a "yum clean all && yum repolist" to verify only my two repositories show up, which they do.

The problem is I end up with 4 repositories…

[root@oel7template yum.repos.d]# yum repolist
Loaded plugins: langpacks, rhnplugin
This system is receiving updates from ULN.
repo id                           repo name                                                                               status
ol7_x86_64_UEKR3                  Unbreakable Enterprise Kernel Release 3 for Oracle Linux 7 (x86_64) - Latest              158
ol7_x86_64_latest                 Oracle Linux 7 Latest (x86_64)                                                          9,212
uswulnrepo01_ol7_UEKR3/x86_64     Unbreakable Enterprise Kernel Release 3 for Oracle Linux 7 (x86_64) - Latest              123
uswulnrepo01_ol7_latest/x86_64    Oracle Linux 7 Latest (x86_64)                                                          6,784
repolist: 16,277

I cannot figure out where ol7_x86_64_UEKR3 and ol7_x86_64_latest are coming from. When I try to get extended info on the repositories (I've removed non-relevant data)…

[root@oel7template yum.repos.d]# yum repolist -v
Looking for repo options for [main]
Looking for repo options for [ol7_x86_64_UEKR3]
Repo 'ol7_x86_64_UEKR3' setting option 'enabled' = '1'
Repo 'ol7_x86_64_UEKR3' setting option 'gpgcheck' = '1'
Repo 'ol7_x86_64_UEKR3' setting option 'timeout' = '120'
Looking for repo options for [ol7_x86_64_latest]
Repo 'ol7_x86_64_latest' setting option 'enabled' = '1'
Repo 'ol7_x86_64_latest' setting option 'gpgcheck' = '1'
Repo 'ol7_x86_64_latest' setting option 'timeout' = '120'

Repo-id      : ol7_x86_64_UEKR3
Repo-name    : Unbreakable Enterprise Kernel Release 3 for Oracle Linux 7 (x86_64) - Latest
Repo-baseurl : https://linux-update.oracle.com/XMLRPC/GET-REQ/ol7_x86_64_UEKR3

Repo-id      : ol7_x86_64_latest
Repo-name    : Oracle Linux 7 Latest (x86_64)
Repo-baseurl : https://linux-update.oracle.com/XMLRPC/GET-REQ/ol7_x86_64_latest

Repo-id      : uswulnrepo01_ol7_UEKR3/x86_64
Repo-name    : Unbreakable Enterprise Kernel Release 3 for Oracle Linux 7 (x86_64) - Latest
Repo-baseurl : http://uswulnrepo01.[REDACTED]/yum/OracleLinux/OL7/UEKR3/x86_64/
Repo-filename: /etc/yum.repos.d/uswulnrepo01_ol7_uekr3.repo

Repo-id      : uswulnrepo01_ol7_latest/x86_64
Repo-name    : Oracle Linux 7 Latest (x86_64)
Repo-baseurl : http://uswulnrepo01.[REDACTED]/yum/OracleLinux/OL7/latest/x86_64/
Repo-filename: /etc/yum.repos.d/uswulnrepo01_ol7_latest.repo

repolist: 13,799

Notice how the top two unwanted linux-update.oracle.com entries don't have a Repo-filename value, nor do they match public-yum.oracle.com which the default public-yum-ol6.repo had.

I've tried everything to remove these entries but I can't figure out how. I've looked around in other yum config files, done some content searches on the /etc/ directory and I can't find anything relevant. I've even deleted the contents of /var/cache/yum/. When I do a "yum repolist" after that, the public yum folders re-appear.

I doubt yum itself was modified by Oracle, so these repos have to be in a config file somewhere… How can I figure out where? Is there a command which lists all config files yum reads?

Edit

I created a new configuration file "/etc/yum.repos.d/ol7_x86_64_UEKR3.repo" as an attempt to permenantly disable the repo:

[ol7_x86_64_UEKR3]
name=Unbreakable Enterprise Kernel Release 3 for Oracle Linux 7 (x86_64) - Latest
enabled=0

And I get a new error (again, removed unnecessary info):

[root@oel7template yum.repos.d]# yum repolist -v
Looking for repo options for [main]
Looking for repo options for [ol7_x86_64_UEKR3]
Repo 'ol7_x86_64_UEKR3' setting option 'enabled' = '1'
Repo 'ol7_x86_64_UEKR3' setting option 'gpgcheck' = '1'
Repo 'ol7_x86_64_UEKR3' setting option 'timeout' = '120'
Repository ol7_x86_64_UEKR3 is listed more than once in the configuration

To me, this reinforces the idea that this setting is in a config file somewhere… But how do I find it?

Best Answer

Edit /etc/yum/pluginconf.d/rhnplugin.conf

And set :

[ol7_x86_64_UEKR3]
enabled=0

[ol7_x86_64_latest]
enabled=0