How to Install EPEL on RHEL7
More information for EPEL, please check follow:
https://fedoraproject.org/wiki/EPEL
Follow install step in my RHEL7:
1. Download EPEL RPM
[root@frank yum.repos.d]# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
--2014-10-01 00:27:11-- http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.24, 209.132.181.23, 209.132.181.25, ...
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.24|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13104 (13K) [application/x-rpm]
Saving to: pel-release-7-2.noarch.rpm
100%[==================================================================================================================>] 13,104 --.-K/s in 0.1s
Last-modified header invalid -- time-stamp ignored.
2014-10-01 00:27:12 (109 KB/s) - pel-release-7-2.noarch.rpmsaved [13104/13104]
2. Install RPM
[root@frank yum.repos.d]# rpm -ivh epel-release-7-2.noarch.rpm
warning: epel-release-7-2.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:epel-release-7-2 ################################# [100%]
[root@frank yum.repos.d]#
[root@frank yum.repos.d]# ll
total 44
-rw-r--r--. 1 root root 13104 Oct 1 00:27 epel-release-7-2.noarch.rpm
-rw-r--r--. 1 root root 957 Sep 2 12:14 epel.repo <<<
-rw-r--r--. 1 root root 1056 Sep 2 12:14 epel-testing.repo <<<
-rw-r--r--. 1 root root 76 Sep 28 02:25 frank.repo
3. After verify EPEL, found follow alarm:
[root@frank yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, langpacks
frank-repo
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=.skip_if_unavailable=true
Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
4. Edit EPEL.repo and workaround it
Remove not enable repo
Use baseurl, not mirrorlist, that should root reason.
Set priority is 10, CD repo’s priority is 1
[root@frank yum.repos.d]# vim epel.repo[epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7[epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch priority=10 enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
5. Verify again:
[root@frank yum.repos.d]# yum clean all Loaded plugins: langpacks Cleaning repos: epel frank-repo Cleaning up everything [root@frank yum.repos.d]# [root@frank yum.repos.d]# yum makecache Loaded plugins: langpacks epel | 4.4 kB 00:00:00 frank-repo | 4.1 kB 00:00:00 (1/8): epel/x86_64/filelists_db | 4.7 MB 00:00:02 (2/8): epel/x86_64/group_gz | 250 kB 00:00:03 (3/8): frank-repo/group_gz | 134 kB 00:00:00 (4/8): frank-repo/filelists_db | 3.0 MB 00:00:00 (5/8): frank-repo/primary_db | 3.4 MB 00:00:00 (6/8): frank-repo/other_db | 1.3 MB 00:00:00 (7/8): epel/x86_64/primary_db | 3.3 MB 00:00:05 (8/8): epel/x86_64/other_db | 1.6 MB 00:00:05 (1/2): epel/x86_64/updateinfo | 33 kB 00:00:02 (2/2): epel/x86_64/pkgtags | 1.2 MB 00:00:04 Metadata Cache Created [root@frank yum.repos.d]# yum repolist Loaded plugins: langpacks repo id repo name status epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 5,921 frank-repo rhel7 repo本文出自 Frank's Blog