centos7 yum安装zabbix国内源

1. 关闭防火墙及 selinux

# systemctl disable firewalld
# systemctl stop firewalld
# firewall-cmd --state
not running
# reboot

 

# vi /etc/selinux/config

 

2. 配置阿里云的zabbix yum 源

配置阿里云zabbix yum源
# rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

备份下载repo文件并替换repo文件
# cd /etc/yum.repos.d/
# mv CentOS-Base.repo CentOS-Base.repo.backup
# wget http://mirrors.aliyun.com/repo/Centos-7.repo
# mv Centos-7.repo CentOS-Base.repo

执行yum源更新命令
# yum clean all
# yum makecache
# yum update -y

 

3. 更换zabbix国内源

更改baseurl的地址为阿里云的地址

# cd /etc/yum.repos.d/
# vi zabbix.repo
[zabbix]

name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $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=1

 

 

添加gpgkey

# curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591 -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
# curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

 

添加之后即可使用,更新源

# yum makecache -y

 

posted on 2021-02-07 14:57  bruce_he  阅读(707)  评论(0)    收藏  举报