我有一台 Centos 6.7 服务器,我想更新它。所以我做了
yum update
但是,这是在实时服务器上进行的(我知道我不太聪明)。服务器资源耗尽,yum 更新中断。我现在无法再运行yum update
。我试过了yum clean all
,但似乎无法启动 yum。
这是我得到的:
# 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
Python 似乎有一个错误,但我不确定如何修复它。
答案1
昨天我也被要求查看一个执行此操作的系统。在我的系统中安装了 2 个版本的 yum
yum-3.2.29-60.el6.centos.noarch
yum-3.2.29-69.el6.centos.noarch
但删除较新的版本(rpm -e
)并没有解决问题。我还必须删除yum-plugin-downloadonly-1.1.30-30.el6.noarch
它及其依赖包yum-cron-3.2.29-69.el6.centos.noarch
。
完成后我就可以再次运行 yum 并运行yum-complete-transaction
。
答案2
尝试在暂时禁用downloadonly
插件的同时进行更新,使用以下命令:
yum update --disableplugin=downloadonly
答案3
我可以通过运行以下命令解决这个问题:
yum install yum-utils
yum-complete-transaction