Since some packages only exist in the Epel source, we add them in CentOS;
The following 2 methods are available, 1 manual, 2 automatic
1. Manual method
Vi/etc/yum.repos.d/epel.repo
Add the following code
[epel]name=extrapackages for enterprise linux 7 - $basearch #baseurl=http:// download.fedoraproject.org/pub/epel/7/$basearchmirrorlist =https://mirrors.fedoraproject.org/metalink?repo= Epel-7&arch= $basearchfailovermethod =priorityenabled=1gpgcheck=0gpgkey=file:///etc/pki/rpm-gpg/ rpm-gpg-key-epel-7 [epel-debuginfo]name=extrapackages for enterprise linux 7 - $basearch - debug#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/ Debugmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch= $basearchfailovermethod = Priorityenabled=0gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-epel-7gpgcheck=1 [epel-source]name= extrapackages for enterprise linux 7 - $basearch - source#baseurl=http ://download.fedoraproject.org/pub/epel/7/srpmsmirrorlist=https://mirrors.fedoraproject.org/metalink?repo= Epel-source-7&arch= $basearchfailovermethod =priorityenableD=0gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-epel-7gpgcheck=1
Update Yum Cache
Yum Makecache
View Yum Source
Yum repolistloaded plugins: fastestmirrorloading mirror speeds from cached hostfile * base: mirrors.zju.edu.cn * epel: mirror01.idc.hinet.net * extras: mirrors.zju.edu.cn * updates: mirrors.zju.edu.cnrepo id repo name statusbase/7/x86_64 CentOS-7 - Base 9,007*epel/x86 _64 extra packages for Enterprise Linux 7 - x86_64 10,547extras/7/x86_64 CentOS-7 - Extras 377updates/7/x86_64 centos-7 - updates 2,311repolist: 22,242
2. Automatic method
Installing the Epel source
Yum Install-y epel-release
View Yum Source
yum repolistloaded plugins: fastestmirrorepel/x86_64/metalink | 5.4 kB 00:00:00 epel | 4.3 kB 00:00:00 (1/3): epel/x86_64/group_gz | 170 kB 00:00:00 (2/3): epel/x86_64/updateinfo | 622 kB 00:00:01 (3/3): epel/x86_64/primary_db | 4.2 mb 00:00:06 Loading mirror speeds from cached hostfile * Base: mirrors.aliyun.com * epel: mirror01.idc.hinet.net * extras: mirrors.cn99.com * updates: centos.ustc.edu.cnrepo id repo name statusbase/7/x86_64 centos-7 -&nbsP base 9,007epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10,548extras/7/x86_64 CentOS-7 - Extras 377updates/7/x86_64 CentOS-7 - Updates 2,311repolist: 22,243
Both of these methods are possible, perhaps the first to adopt a foreign source for some users does not apply.
On my side, these two kinds of differences are not big.
This article is from the "Seoul and the same Sorrow" blog, please be sure to keep this source http://mannerwang.blog.51cto.com/12009183/1852806
Centos 7 Add Epel Source