Linux

無法禁用 yum 儲存庫“RhnRepo”對像沒有屬性“cfg”

  • July 15, 2019

我一直無法禁用以下儲存庫,而且我似乎在任何地方都找不到配置文件,所以我想它是手動刪除的:

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'

/etc/yum.repos.d通過在包含 repo 配置的目錄中創建一個文件,將第三方儲存庫添加到系統中(redhat.repo包含您訂閱的所有 RHEL 儲存庫的配置除外)。如果您不再打算使用此 repo,您​​可以在該目錄中查找相應的 repo 文件並將其刪除。

請注意,由於您似乎從 Red Hat Satellite 接收更新,Satellite 伺服器可能會將 repo 添加回系統。在這種情況下,請聯繫您的 Satellite 管理員以刪除 repo。

引用自:https://serverfault.com/questions/975306