百胜更新错误:“无法启动新线程”

百胜更新错误:“无法启动新线程”

我找到了几个关于此的帖子,但没有一个起作用。

当我这样做时yum update,我收到错误thread.error: can't start new thread;完整的堆栈跟踪如下:

[root@ripper234 ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 178, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 345, in doCommands
    self._getTs(needTsRemove)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 101, in _getTs
    self._getTsInfo(remove_only)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 112, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 661, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 501, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 232, in populateSack
    self.doSetup()
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 79, in doSetup
    self.ayum.plugins.run('postreposetup')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/fastestmirror.py", line 181, in postreposetup_hook
    all_urls = FastestMirror(all_urls).get_mirrorlist()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 333, in get_mirrorlist
    self._poll_mirrors()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 376, in _poll_mirrors
    pollThread.start()
  File "/usr/lib/python2.4/threading.py", line 416, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

我已经尝试过yum clean,但没有帮助。

我的操作系统是 Centos 5.5。

答案1

这主要是 CentOS 5.5+ 版本中的问题yum,是由fastestmirror插件引起的。绕过的一种方法是使用yum update --disableplugin=fastestmirror.

使用而不是完全禁用插件的最佳方法是减少线程数。为此,只需编辑/etc/yum/pluginconf.d/fastestmirror.conf文件并将值更改maxthreads=xx为较低的值即可。

我的默认值为 15,并且在 150MB+ 可用 RAM 时出现错误;我把它改成5,就没有再遇到麻烦了。

答案2

您可以尝试禁用fastestmirror插件并检查更改后是否yum可以正常工作。要禁用它,请执行以下操作:编辑/etc/yum/pluginconf.d/fastestmirror.conf并更改enabled = 10或仅删除插件包:yum remove yum-fastestmirroryum remove yum-plugin-fastestmirror

相关内容