4

I have a Centos 6.7 server, which I wanted to update. So I did

yum update

However, this was on a live server (not very smart of me, I know). The server ran out of resources and the yum update got interrupted. I can now no longer run yum update. I have tried yum clean all, but can't seem to start yum.

This is what I get:

# yum update
Loaded plugins: downloadonly, fastestmirror
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 300, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 115, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 229, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 911, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 335, in _getConfig
    startupconf.pluginconfpath,disabled_plugins,enabled_plugins)
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 564, in doPluginSetup
    plugin_types, confpath, disabled_plugins, enabled_plugins)
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 167, in __init__
    self.run('config')
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/downloadonly.py", line 30, in config_hook
    default=False, help="don't update, just download")
  File "/usr/lib64/python2.6/optparse.py", line 1020, in add_option
    self._check_conflict(option)
  File "/usr/lib64/python2.6/optparse.py", line 995, in _check_conflict
    option)
optparse.OptionConflictError: option --downloadonly: conflicting option string(s): --downloadonly

There seems to be an error with Python, but I'm not sure how to fix it.

3 Answers3

4

I was asked to look at a system doing this yesterday too. In my case there were 2 versions of yum installed

yum-3.2.29-60.el6.centos.noarch
yum-3.2.29-69.el6.centos.noarch

but removing the newer version (rpm -e) didn't solve the problem. I also had to remove yum-plugin-downloadonly-1.1.30-30.el6.noarch and it's dependent package yum-cron-3.2.29-69.el6.centos.noarch.

Once that was done I was able to run yum again and ran yum-complete-transaction.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • I tried deleting those packages with {rpm -e} but that only led to the warning that I should remove a dependent package, which was repeated again when I tried to remove that dependent package. – Patrick Steenks Feb 15 '16 at 13:25
4

Try to updating while temporary disabling the downloadonly plugin, using the command:

yum update --disableplugin=downloadonly

shodanshok
  • 47,711
  • 7
  • 111
  • 180
  • In my case this allowed yum to run but didn't then solve the problem as yum reported nothing there was nothing to update. I still had to remove yum-cron and it's dependencies. – user9517 Feb 12 '16 at 08:50
  • This inderdaad allowed me to run Yum, but then I get another error about a system dependency. – Patrick Steenks Feb 15 '16 at 13:24
2

I was able to solve this by running:

yum install yum-utils 
yum-complete-transaction