In this post we will learn how to install EPEL repo on CentOS 7 and RHEL 7. On our previous post of “How to install EPEL repo in CentOS/Scientific Linux/Red Hat” , we have already written about EPEL repo.
Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Enterprise Linux (OEL). (Reference : EPEL)
Install EPEL repo on CentOS 7 / RHEL 7
Method 1 : By directly using yum command
On CentOS 7, we have found without downloading the epel-release RPM package(as we used to do on previous O.S releases), we can install it by using yum command.
yum install epel-release
See below given reference from our system.
[root@localhost ~]# yum install epel-release Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.excellmedia.net * extras: centos.excellmedia.net * updates: centos.excellmedia.net Resolving Dependencies --> Running transaction check ---> Package epel-release.noarch 0:7-2 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================= Installing: epel-release noarch 7-2 extras 13 k Transaction Summary ================================================================================================================================================= Install 1 Package Total download size: 13 k Installed size: 22 k Is this ok [y/d/N]: y Downloading packages: epel-release-7-2.noarch.rpm | 13 kB 00:00:05 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : epel-release-7-2.noarch 1/1 Verifying : epel-release-7-2.noarch 1/1 Installed: epel-release.noarch 0:7-2 Complete! [root@localhost ~]#
Method 2: Download epel-release rpm package then install
Visit the link of EPEL repo and find the package name called epel-release-x-x.noarch.rpm (here x-x is version number)
Download the epel-release-x-x.noarch.rpm package from epel repo url and install with the help of rpm command.
EPEL repo URL for 7 version(Enterprise Linux version) : http://dl.fedoraproject.org/pub/epel/7/
For x86_64 Operating System architecture:
yum install wget wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/e/ rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-*.rpm
Method 3: Directly installing from HTTP by using rpm command
By directly using rpm command with http URL address(for x86_64),you can also install epel-release package. Make sure, to get the correct HTTP address from EPEL’s URL
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
File Created after epel installation
After installation of epel rpm package. The two files will be created.
1. /etc/yum.repos.d/epel.repo
2. /etc/yum.repos.d/epel-testing.repo
Hi Sharad,
Appreciate your blog and it is very informative. I had installed centos 6.4 with httpd 2.2, php 3.3, mysql 5.x and we launched our software at the national level. A security audit was done and they said the versions of apache, httpd and php should be higher. Can Centos 7 solve this issue? Does httpd 2.4 come by default with Centos 7? I would be grateful if you could give me the link to install higher version of LAMP on Centos 7? Thanks a lot.
Hello Patrick,
This is a very good question on professional and enterprise level. I will give you my answer which I earned from my professional career.
1. Ok, here is bitter truth of Auditing. They always recommend the latest and stable version, it could be either Operating System and Software.
Now what is the challenge from above requirement.
1. The Official repository never have always all softwares in latest stable version. For eg. PHP , its latest stable version is 7.1.3 which you can download and it is available in compressed format like zip, tar etc. You have to compile the downloaded package in system. BUT you won’t install php by compiling because in system you have installed via yum command.
Alternatively the third party yum repo like EPEL and SCL could help you to get nearest stable release package.
In Auditing, it may give you suggestion that install particular package above some version. Eg. Above Apache 2.2 .
Now question come, what is the solution.
1. If you are compiling the packages then nothing to worry, you have to just upgrade the package version.
2. In case of using yum then you should give true and false case by educating to auditor that available package is best available and from official sources this is the latest stable version. And if we go with source compiling approach then it could break the system. Always try to reach nearest stable version and also check its severe vulnerability.
3. Do not blindly use unreliable third party repositories or do not ever download unreliable packages. It may lead to serious problem in your system and in some cases I have witnessed server has been hacked or used for DDOS etc.
Final note:
Use CentOS 7, by default you would get Apache 2.4 and install latest MySQL 5.7 .
I hope the answer has cleared your doubts , I know the reply is quite lengthy which I always try to avoid such long writing in this manner.
Regards
Sharad