RHEL6.6搭建CentOS6.6 yum源

現需要在RHEL6.6上安裝zabbix2.4,通過虛擬機橋接互聯網yum方式安裝,但yum –y installnet-snmp zabbix zabbix-server的時候報如下錯誤,導致安裝不上:

wKiom1XbEPLzc0Q9AAGUbnRlKrM302.jpg

這個錯誤是由於沒有註冊引起的,怎麼辦呢?網上也查了一些資料,按照網上的資料,現將爲自己的環境整理搭建了一下CentOS6.6 yum源!

 

  1. 把原來的yum源卸載掉

# rpm -qa | grep yum | xargs rpm -e –nodeps

 

  1. 添加並安裝下載的yumrpm

# rpm -ivhpython-iniparse-0.3.1-2.1.el6.noarch.rpm

# rpm -ivhyum-metadata-parser-1.1.2-16.el6.x86_64.rpm

# rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

[]:最後這兩個包必須同時安裝,因兩個是相互依賴關係。

 

  1. 添加163yum

# cd/etc/yum.repos.d/

# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

 

 

  1. 修改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

~

~

~

~

~

~

~

~

~

~

~

  1. # yum clean all    //清理yum緩存

  2. # yum makecache    //將服務器上的軟件包信息緩存到本地,以提高搜索安裝軟件的速度

  3. # yum install vim*  //測試yum是否可用

 

    至此,搭建CentOS6.6yum源已成功。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章