本帖最后由 新手719447 于 2020-10-1 19:31 编辑
centos yum报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:
报错:
报错一:
File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
报错二:
File "/usr/libexec/urlgrabber-ext-down", line 28
except OSError, e:
原因:
以上两个报错,是因为我安装python3之后,同时让它作为默认版本软链接到/usr/bin/python导致。
yum默认使用系统自带的python2.7作为解释器,现在默认python3.6,也就解析2.7语法报错了。
解决方法:
报错一:
编辑/usr/bin/yum,将第一行原本/usr/bin/python修改为/usr/bin/python2即可,如下所示:
#!/usr/bin/python2
import sys
try:
import yum
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
...(以下省略)
报错二:
编辑/usr/libexec/urlgrabber-ext-down,也是把第一行修改为/usr/bin/python2即可,如下所示:
#! /usr/bin/python2
# A very simple external downloader
# Copyright 2011-2012 Zdenek Pavlas
import time, os, errno, sys
from urlgrabber.grabber import \
_readlines, URLGrabberOptions, _loads, \
PyCurlFileObject, URLGrabError
...(以下省略)
修正之后就可以正常使用yum了!
查看日志
每当装好,阿帕奇下面就会多一个文件
vim /var/log/zabbix/zabbix_server.log
ls /etc/httpd/conf.d/ |