Unable to disable yum repository 'RhnRepo' object has no attribute 'cfg'

itChi asked:

I’ve been unable to disable the following repo, also I can’t seem to find a config file anywhere, so I would imagine it was removed manually:

yum-config-manager --disable rhel7-x-suse-manager-tools-x86_64
Loaded plugins: langpacks, product-id, rhnplugin, subscription-manager
This system is receiving updates from RHN Classic or Red Hat Satellite.
===================================== repo: rhel7-x-suse-manager-tools-x86_64 ======================================
[rhel7-x-suse-manager-tools-x86_64]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7Server
baseurl = https://azsu-c-app-121.azure.uk.centricaplc.com/XMLRPC/GET-REQ/rhel7-x-suse-manager-tools-x86_64
cache = 0
cachedir = /var/cache/yum/x86_64/7Server/rhel7-x-suse-manager-tools-x86_64
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage = 75
enabled = 0
enablegroups = True
exclude =
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7Server/rhel7-x-suse-manager-tools-x86_64/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7Server/rhel7-x-suse-manager-tools-x86_64/gpgdir
gpgkey =
hdrdir = /var/cache/yum/x86_64/7Server/rhel7-x-suse-manager-tools-x86_64/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
label = rhel7-x-suse-manager-tools-x86_64
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist =
mirrorlist_expire = 86400
name = RHEL7-x SUSE-Manager-Tools x86_64
password =
persistdir = /var/lib/yum/repos/x86_64/7Server/rhel7-x-suse-manager-tools-x86_64
pkgdir = /var/cache/yum/x86_64/7Server/rhel7-x-suse-manager-tools-x86_64/packages
proxy =
proxy_dict = {'ftp': '', 'http': '', 'https': ''}
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
rhn_needed_headers = X-RHN-Server-Id,
   X-RHN-Auth-User-Id,
   X-RHN-Auth,
   X-RHN-Auth-Server-Time,
   X-RHN-Auth-Expire-Offset
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert = /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 120.0
ui_id = rhel7-x-suse-manager-tools-x86_64
ui_repoid_vars = releasever,
   basearch
up2date_cfg = <up2date_client.config.Config instance at 0x7f3c363d7bd8>
username =
Traceback (most recent call last):
  File "/bin/yum-config-manager", line 205, in <module>
    repo.cfg.options, repo.iteritems, repo.optionobj,    AttributeError: 'RhnRepo' object has no attribute 'cfg'

My answer:


Third party repositories are added to the system by creating a file in the /etc/yum.repos.d directory which contains the repo configuration (except redhat.repo contains configuration for all of the RHEL repos you are subscribed to). If you no longer intend to use this repo, you can look for the corresponding repo file in that directory and delete it.

Be aware that since you appear to be receiving updates from Red Hat Satellite, the Satellite server may add the repo back to the system. Contact your system administrator to have the repo removed in this case.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.