linux Centos6 安装yum源(epel与dag)

linux Centos6 安装yum源(epel与dag)

一、安装epel源:

1.新建一个目录放下载的rpm文件 //我一般放在 /usr/local/download/rpm/ 下面

mkdir /usr/local/download

mkdir /usr/local/download/rpm

2.下载epel的RPM文件

wget -P /usr/local/download/rpm http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm// 如需其他版本也到这个网址里面寻找 如果没有wget 请先安装

3. 安装epel的RPM文件

rpm -ivh /usr/local/download/rpm/epel-release-6-8.noarch.rpm

4.导入epel的KEY

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

5.修改epel源优先级别

vi /etc/yum.repos.d/epel.repo 

// 在[epel]最后添加一条属性 priority=11 结果如下:

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
priority=11

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0

二、添加dag源:

1.编辑文件dag.repo文件

vi /etc/yum.repos.d/dag.repo

2.按字母"a"进入install模式

3.在dag.repo中写入以下内容

[dag]
name=Dag RPM Repository
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1

4.按“esc”然后输入":wq"保存并退出(OK完成 可以使用yum了  第一次使用会自动更新目录)

 

posted @ 2013-01-23 13:33  几度易水  阅读(958)  评论(0编辑  收藏  举报