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 Repositorybaseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/daggpgcheck=1gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txtenabled=1