可以去修改/etc/yum.repos.d/zabbix.repo 改成阿里云的即可
例如
[zabbix]
name=Zabbix Official Repository - $basearch
#baseurl=http://repo.zabbix.com/zabbix/3.4/rhel/7/$basearch/
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
#baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
因为我安装老报这种错
获取 GPG 密钥失败:[Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591"
解决方法
这里的gpgcheck=0是我修改过的(默认是1:检查源)0的意思是在安装的时候不进行源的检查
这样就能下载了
假如你多次下载不成功可以尝试以下方法
先 yum clean all
配置yum源 cd /etc/yum.repos.d/
[root@zabbix-server yum.repos.d]# vim zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
#baseurl=http://repo.zabbix.com/zabbix/3.4/rhel/7/$basearch/
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
#baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
而后更新我们的yum仓库 yum repolist
[root@zabbix-server ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
[root@zabbix-server ~]# yum install -y zabbix-get
假如报以下错误
获取 GPG 密钥失败:[Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591"
就将zabbix.repo中的gpgcheck=1改为gpgcheck=0即可(意思是在安装的时候不进行源的检查)