[LINUX] I tried to summarize how to use the EPEL repository again

1.First of all

Many people are using the extension package repository ** "EPEL" ** in RHEL-based distributions. The author has also introduced it several times in previous articles. However, the situation is slightly different in the cloud. So I decided to summarize how to use it.

1-1. TL;DR

1-2. Prerequisites

2. What is EPEL?

The procedure for using EPEL is simple. If you want to install immediately ["3. Enable EPEL repository"](https://qiita.com/yamada-hakase/items/fdf9c276b9cae51b3633#3-epel%E3%83%AA%E3%83%9D % E3% 82% B8% E3% 83% 88% E3% 83% AA% E3% 82% 92% E6% 9C% 89% E5% 8A% B9% E3% 81% AB% E3% 81% 99% E3 Please proceed to% 82% 8B). This section describes the outline of EPEL and precautions for using it.

2-1. The most famous third party repository EPEL

EPEL (Extra Packages for Enterprise Linux) is a group of optional packages for Red Hat Enterprise Linux (RHEL) Linux distributions built by volunteers of the Fedora Project. ** Be the first choice for sources of packages that are not included in Linux media or Yum repositories. ** **

Repositories provided by companies other than the original distribution, such as EPEL, are called "third-party repositories". Besides EPEL, the following repositories are also famous.

2-2. Why do you need a third party repository?

The reason is simple: "The application you want to use is not included in the standard Yum repository" or "Even if it is included, the version is old". This is a reason for distribution support.

These issues can be improved with Software Collections (SCL) up to RHEL7 and AppStream with RHEL8, but not all issues are resolved.

2-2-1. Install from source?

Some people will build from source when these issues occur. It does not deny installation from source code, but it undermines the benefits of a package management system. You should only do it when you have a good reason.

** Disadvantages when building from source **

2-2-2. Compatibility story

The table below summarizes the kernel and glibc versions for each RHEL version. Within the same major version, the package version does not change even if the update package is applied. </ font>

Distribution kernel glibc
RHEL6 2.6.32 2.12
RHEL7 3.10.0 2.17
RHEL8 4.18.0 2.28
Amazon Linux 2 4.14 2.26

The RPM package is named as follows. For core components such as kernel and glibc, it is the release number given after the version that changes when you run yum update. rpm-version.PNG The reason I write so persistently is that core components such as kernel and glibc are extremely important in ensuring the operation of applications.

** So don't use stray repositories that you don't know where to go, and don't force yourself to install RPM packages for RHEL6 on RHEL7. ** </ font>

** Digression </ font> ** There is a horror story that I experienced. It happened when I was checking the settings of RHEL6 with the support of a certain obstacle. Some basic commands don't work. I thought it was strange, and when I searched for packages other than Red Hat with the following command, many came out.

Command for Vender to display packages other than RedHat


rpm -qa --qf "%{name} %{vendor}\n"  | grep -v "Red Hat"

The core components such as glibc are Fedora and Scientific Linux. It's not the release number but the version number. It seems that you installed something that you couldn't originally install with nodeps or force. If you do such a brute force, it is natural that it will not work properly. It is no wonder that it was moving on the contrary.

3. Enable the EPEL repository

To use EPEL, install the ʻepel-release` package. However, there are the following notes depending on the cloud service and Linux distribution used. See also the EPEL website (https://fedoraproject.org/wiki/EPEL).

  • RHEL7 requires ʻoptional and ʻextras repositories to be enabled
  • RHEL8 requires the codeready-builder repository to be enabled
  • AWS Amazon Linux 2 has a dedicated command to enable EPEL
  • In Oracle Linux 7 of Oracle Cloud Infrastructure, a dedicated EPEL repository is enabled by default.

3-1. Enable EPEL (basic)

Install ʻepel-release` in" When using RHEL or CentOS in the cloud "or" On-premises environment ". This is the basis.

** 8-series Linux OS **

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y

** 7 series Linux OS **

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y

** 6 series Linux OS **

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm -y

3-2. Enable EPEL (AWS)

Amazon Linux 2 has a dedicated command to enable EPEL. Even on AWS, RHEL and CentOS use the above method.

sudo amazon-linux-extras install epel

If the installation is successful, ** "amzn2 extra-epel" ** and ** "epel" ** repositories will be added.

$ yum repolist enabled
repo id                    repo name                                   status
amzn2-core/2/x86_64        Amazon Linux 2 core repository                  19791
amzn2extra-docker/2/x86_64 Amazon Extras repo for docker                      28
amzn2extra-epel/2/x86_64★ Amazon Extras repo for epel                         1
epel/x86_64★              Extra Packages for Enterprise Linux 7 - x86 13141+192
repolist: 32961

I am worried that the number of packages in the amzn2extra-epel repository is 1. When I looked it up, it contained only epel-release.

If you check the definition of the repo file, it refers to the EPEL mirror site, and there is no AWS-specific mirror site in the cloud. When I check the log, it is obtained from cloudfront.

:/etc/yum.repos.d/epel.repo


[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch ★ Get mirror site
failovermethod=priority

3-2. Enable EPEL (Oracle Cloud Infrastructure)

Oracle Linux 7 of Oracle Cloud Infrastructure has a dedicated EPEL repository called ** "ol7_developer_EPEL" **. Therefore, no additional work is required, but other OSs use the above method.

You can check if the EPEL repository is enabled with the following command.

$ yum repolist
repo id                         repo name                                 status
ol7_UEKR5/x86_64                Latest Unbreakable Enterprise Kernel Rele   217
ol7_addons/x86_64               Oracle Linux 7Server Add ons (x86_64)       433
ol7_developer/x86_64            Oracle Linux 7Server Development Packages  1349
ol7_developer_EPEL/x86_64 ★ This is Oracle Linux 7Server Development Packages 32336
ol7_ksplice                     Ksplice for Oracle Linux 7Server (x86_64)  7356
ol7_latest/x86_64               Oracle Linux 7Server Latest (x86_64)      18986
ol7_oci_included/x86_64         Oracle Software for OCI users on Oracle L   321
ol7_optional_latest/x86_64      Oracle Linux 7Server Optional Latest (x86 13984
ol7_software_collections/x86_64 Software Collection Library release 3.0 p 14564
repolist: 89546

When checking the definition of the repo file, it refers to Oracle's own EPEL prepared for each region.

:/etc/yum.repos.d/oracle-epel-ol7.repo


[ol7_developer_EPEL]
name=Oracle Linux $releasever Development Packages ($basearch)
baseurl=http://yum$ociregion.oracle.com/repo/OracleLinux/OL7/developer_EPEL/$basearch/

When I check the pwgen package installed from ** ol7_developer_EPEL **, the build host (Build Host) and vendor (Vendor) are not " fedora ". Therefore, you can see that the source package is obtained from EPEL and rebuilt.

$ rpm -qi pwgen
Name        : pwgen
Version     : 2.08
Release     : 1.el7
★ Omitted
Source RPM  : pwgen-2.08-1.el7.src.rpm
Build Date  : Tue Aug 14 22:24:07 2018
Build Host  : x86-ol7-builder-01.us.oracle.com ★
Relocations : (not relocatable)
Vendor      : Oracle America ★
URL         : http://sf.net/projects/pwgen
Summary     : Automatic password generation
★ Omitted below

** Important </ font> ** EPEL and ol7_developer_EPEL are not exactly the same binary because they follow the procedure of "getting the source package from EPEL and building". In addition, there is a possibility of a time lag such as version. </ font>

If the installation of the package in ol7_developer_EPEL fails due to dependency etc., try switching to EPEL. </ font>

4. Further mastery of EPEL

4-1. Enable / disable EPEL

When using an additional repository, not limited to EPEL, there are two methods, "Always enable" and "Temporarily enable". It is common to always enable EPEL once you start using it, but if you want to explicitly distinguish EPEL packages, you can distinguish them by "temporarily enabling".

** Always enable ** Enabled when displayed with yum repolist. Also, the repo file has ʻenabled = 1`.

** Temporarily enable ** This method disables EPEL and enables it only when needed.

  1. Disable EPEL. Now when you run yum, you can't use the EPEL package.
sudo yum-config-manager --disable epel
  1. Enable with the --enablerepo option only when installing / updating packages in EPEL.
sudo yum --enablerepo=epel install <package name>

4-2. Troubleshooting

** Scheduled to write when there is spare capacity **

5. Summary

  • ** Look for EPEL if you have a package that is not in the standard repository **
  • ** Do not use stray repositories. When using it, be prepared for a human pillar **
  • ** Do not force yourself to break the RPM package dependency **
  • ** AWS provides its own command to enable EPEL **
  • ** Oracle Linux 7 on Oracle Cloud Infrastructure provides its own EPEL repository **

Recommended Posts