現須要在RHEL6.6上安裝zabbix2.4,經過虛擬機橋接互聯網yum方式安裝,但yum –y installnet-snmp zabbix zabbix-server的時候報以下錯誤,致使安裝不上:node
這個錯誤是因爲沒有註冊引發的,怎麼辦呢?網上也查了一些資料,按照網上的資料,現將爲本身的環境整理搭建了一下CentOS6.6 yum源!python
把原來的yum源卸載掉vim
# rpm -qa | grep yum | xargs rpm -e –nodepscentos
添加並安裝下載的yum的rpm包緩存
# rpm -ivhpython-iniparse-0.3.1-2.1.el6.noarch.rpm服務器
# rpm -ivhyum-metadata-parser-1.1.2-16.el6.x86_64.rpmless
# rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpmide
[注]:最後這兩個包必須同時安裝,因兩個是相互依賴關係。測試
添加163的yum源this
# cd/etc/yum.repos.d/
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
修改CentOS6-Base-163.repo
#CentOS-Base.repo
#
# The mirrorsystem uses the connecting IP address of the client and the
# update statusof each mirror to pick mirrors that are updated to and
# geographicallyclose to the client. You should use thisfor CentOS updates
# unless you aremanually picking other mirrors.
#
# If the mirrorlist=does not work for you, as a fall back you can try the
# remarked outbaseurl= line instead.
#
#
[base]
name=CentOS-6 - Base- 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#releasedupdates
[updates]
name=CentOS-6 -Updates - 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that may be useful
[extras]
name=CentOS-6 -Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus- 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib -packages by Centos Users
[contrib]
name=CentOS-6 -Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
~
~
~
~
~
~
~
~
~
~
~
# yum clean all //清理yum緩存
# yum makecache //將服務器上的軟件包信息緩存到本地,以提升搜索安裝軟件的速度
# yum install vim* //測試yum是否可用
至此,搭建CentOS6.6的yum源已成功。