当Linux执行

yum check-update

有时候会报如下错误(一般都是因为服务器配置太低导致的)
请输入图片描述

Loaded plugins: fastestmirror Loading mirror speeds from cached
hostfile Could not get metalink
https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64
error was 14: Peer cert cannot be verified or peer cert invalid
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 294, in user_main
errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 146, in main
result, resultmsgs = base.doCommands() File "/usr/share/yum-cli/cli.py", line 438, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File
"/usr/share/yum-cli/yumcommands.py", line 647, in doCommand
ypl = base.returnPkgLists(extcmds) File "/usr/share/yum-cli/cli.py", line 992, in returnPkgLists
ignore_case=True) File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 2404, in
doPackageLists
for (n,a,e,v,r) in self.up.getUpdatesList(): File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 925, in

up = property(fget=lambda self: self._getUpdates(), File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 743, in
_getUpdates
self._up = rpmUtils.updates.Updates(self.rpmdb.simplePkgList(), self.pkgSack.simplePkgList()) File
"/usr/lib/python2.6/site-packages/yum/__init__.py", line 906, in

pkgSack = property(fget=lambda self: self._getSacks(), File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 686, in
_getSacks
self.repos.populateSack(which=repos) File "/usr/lib/python2.6/site-packages/yum/repos.py", line 290, in
populateSack
self.doSetup() File "/usr/lib/python2.6/site-packages/yum/repos.py", line 105, in doSetup
self.ayum.plugins.run('postreposetup') 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/fastestmirror.py", line 202, in
postreposetup_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.6/threading.py", line 474, in start
_start_new_thread(self.__bootstrap, ()) thread.error: can't start new thread

解决办法:

vi /etc/yum.conf

增加参数

sslverify=false
Last modification:November 24th, 2019 at 06:14 pm