If you found error thread.error: can’t start new thread on yum update command on CentOS 6, CentOS 7 or CentOS 9, this usually happens with VPS, usually because the server owner is over selling or limiting your VPS.
I have this bad experience with VPS hosted by Contabo and Digital Ocean.
# sudo yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 7.5 kB 00:00:00
Traceback (most recent call last):
File "/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 375, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 184, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 585, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
File "/usr/share/yum-cli/yumcommands.py", line 505, in doCommand
ret = base.updatePkgs(extcmds, update_to=(basecmd == 'update-to'))
File "/usr/share/yum-cli/cli.py", line 1069, in updatePkgs
self.update()
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 5149, in update
updates = self.up.getUpdatesTuples()
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1094, in <lambda>
up = property(fget=lambda self: self._getUpdates(),
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 838, in _getUpdates
self._up = rpmUtils.updates.Updates(self.rpmdb.simplePkgList(), self.pkgSack.simplePkgList())
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1075, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 778, in _getSacks
self.repos.populateSack(which=repos)
File "/usr/lib/python2.7/site-packages/yum/repos.py", line 347, in populateSack
self.doSetup()
File "/usr/lib/python2.7/site-packages/yum/repos.py", line 122, in doSetup
self.ayum.plugins.run('prereposetup')
File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/fastestmirror.py", line 202, in prereposetup_hook
all_urls = FastestMirror(all_urls).get_mirrorlist()
File "/usr/lib/yum-plugins/fastestmirror.py", line 369, in get_mirrorlist
self._poll_mirrors()
File "/usr/lib/yum-plugins/fastestmirror.py", line 413, in _poll_mirrors
pollThread.start()
File "/usr/lib64/python2.7/threading.py", line 747, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread
You can fix using this command line when update:
yum update --disableplugin=fastestmirror
Now yum update can continue without error thread.error: can’t start new thread.