什么是企业版 Linux 附加软件包(EPEL)?bash

        企业版 Linux 附加软件包(如下简称 EPEL)是一个由特别兴趣小组建立、维护并管理的,针对 红帽企业版 Linux(RHEL)及其衍生发行版(好比 CentOS、Scientific Linux、Oracle Enterprise Linux)的一个高质量附加软件包项目。ide

EPEL 的软件包一般不会与企业版 Linux 官方源中的软件包发生冲突,或者互相替换文件。EPEL 项目与 Fedora 基本一致,包含完整的构建系统、升级管理器、镜像管理器等等。测试

如何获取 EPEL 的软件包?url

       EPEL 包含一个叫作'epel-release'的包,这个包包含了 EPEL 源的 gpg 密钥和软件源信息。您能够经过 yum 安装到您的企业版 Linux 发行版上。除了 epel-release 源,还有一个叫作'epel-testing'的源,这个源包含最新的测试软件包,其版本很新可是安装有风险,请自行斟酌。debug

为了搞个epel源,学到了一个叫作程序锁的东东,下面会有说明blog

        搭建epel源以下:图片

  1.    我所用的系统是red hat 6 ip

  2.    我先用 rpm -qa | grep epel查看是否装有epel的rpm软件包。ci

   我一开始是没有装的,因此我wget一个
get

          wget http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

          或者  http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F 在这里下载

  3.     安装epel-release-6-8.noarch.rpm         

[root@localhost mnt]# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
        package epel-release-6-8.noarch is already installed
[root@localhost mnt]#

由于我以前安装了

4. 安装完以后咱们就会在 /etc/yum.repos.d/ 看到两个配置文件,epel.repo 和epel-testing.repo

     rhel-source.repo.bak这个文件是我以前作的本地yum我备份了下 

[root@localhost mnt]# ls /etc/yum.repos.d/
epel.repo  epel-testing.repo  rhel-source.repo.bak

5. 到这里基本上就结束了

    在epel.repo的配置文件中,默认的地址是mirrorlist=,可是咱们要用的是baseurl=,全部咱们要手动改过来,咱们yum repolist 下看看wKioL1W45tig_v_vAAMVOJot-gc369.jpg

    出现这种错误,我是搞了半天没搞出来,结果问了下大牛把/var/run/yun.pid 删除就行了,缘由是上面我提到的程序锁,另外一个程序锁定了yum等待退出,结果我删除了果然仍是好了

下面是个人epel.repo的配置文件内容 

[root@localhost mnt]# cat /etc/yum.repos.d/epel.repo
[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
[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=1
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=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[root@localhost mnt]#

接下来咱们仍是继续yum repolist

[root@localhost mnt]# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id         repo name                                                 status
epel            Extra Packages for Enterprise Linux 6 - x86_64            11,742
epel-debuginfo  Extra Packages for Enterprise Linux 6 - x86_64 - Debug     2,212
epel-source     Extra Packages for Enterprise Linux 6 - x86_64 - Source        0
repolist: 13,954
[root@localhost mnt]#
OK了。


注:若有不对的地方请各位告知,以方便及时改正错误!!!