1. 程式人生 > >安裝zabbix及修改yum源為163的CentOS源

安裝zabbix及修改yum源為163的CentOS源

OS的版本

[[email protected] yum.repos.d]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[[email protected] yum.repos.d]#

安裝zabbix的文件

https://www.zabbix.com/cn/download?zabbix=4.0&os_distribution=oracle&os_version=7&db=MySQL

在安裝zabbix的時候,提示發現有兩個包沒法安裝 ,這兩個包是bcmatch和mbstring兩個包,而且redhat的安裝光碟上是沒有這兩個包的。看了一些文件,,提示註冊過redhat作業系統後,會更新這兩個包。換一種方法,換centos的源來更新。

先下載CentOS 的源

[[email protected] yum.repos.d]#wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

修改源的內容,主要修改了3個地方

[[email protected] yum.repos.d]# more CentOS7-Base-163.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&rep
o=os
#baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
baseurl=http://mirrors.163.com/centos/7/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&rep
o=updates
#baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
baseurl=http://mirrors.163.com/centos/7/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&rep
o=extras
#baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
baseurl=http://mirrors.163.com/centos/7/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[
[email protected]
yum.repos.d]#

清除和建立YUM快取

yum clean all
yum makecache 

再次安裝zabbix,可以了

yum install zabbix-server-mysql zabbix-web-mysql 

END