Sunday, April 3, 2022

Traceback (most recent call last): File "/bin/yum-config-manager", line 205, in repo.cfg.options, repo.iteritems, repo.optionobj, AttributeError: 'RhnRepo' object has no attribute 'cfg'

I got this error after upgrading Oracle Linux 6.10 to 7.9. I tried to work with repositories - I was going to disable old of OL6 and enable some new of OL7. Any manipulations with repositories using yum-config-manager command, led to this strange error :

# yum-config-manager --enable '*'

...

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'

The solution was to disable the plugin rhn (set enabled=0) in the /etc/yum/pluginconf.d/rhnplugin.conf: and repeat failed yum-config-manager command after that. Below is the context of modified rhnplugin.conf file :

$ cat /etc/yum/pluginconf.d/rhnplugin.conf
[main]
enabled = 0
gpgcheck = 1
timeout = 120

# You can specify options per channel, e.g.:
#
#[rhel-i386-server-5]
#enabled = 1
#
#[some-unsigned-custom-channel]
#gpgcheck = 0


Good Luck !


No comments:

Post a Comment