前言
今天安装zabbix是时,一直报错尝试了很多解决办法。现进行记录,帮助大家少走弯路。
失败的解决办法
- 网上最多的解决办法就是
清缓存
yum clean all
yum makecache
yum update
2.下载ftp和talent(这个可能有用)
[root@server ~]# rpm -qa |grep ftp
[root@server ~]# rpm -qa |grep telnet-*
[root@server ~]# yum install ftp-* -y
[root@server ~]# yum install telnet-* -y
最终解决办法
首先感谢 https://www.cnblogs.com/opsprobe/p/11717539.html 这位博主提出的办法。他的办法是换源。我也一直认为是被墙了,无法下载下来,但是LT出去还是报错。最后换源下载成功。
这里是我根据博主换成阿里的源仍然不行,后面在查找到了清华的源。下面以代码形式贴出。
首先编辑
vim /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
#baseurl=http://repo.zabbix.com/zabbix/4.0/rhel/7/$basearch/
baseurl=https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/$basearch/
#这里我们换成清华的yum源
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
#baseurl=http://repo.zabbix.com/zabbix/4.0/rhel/7/$basearch/debuginfo/
baseurl=https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/$basearch/debuginfo/
#换了上面Zabbix的安装源地址,其组件地址也要记得换!
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
#baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
baseurl=https://mirror.tuna.tsinghua.edu.cn/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1