In this process, we will investigate the desire to take full advantage of the packages that are available to CentOS by installing both the EPEL and Remi repositories. CentOS is an enterprise-based operating system that prides itself on stability, and during the lifetime of your server, it is possible that not every piece of software you need can be found in the default repositories. It is also possible that you may require updated packages of current software, and for these reasons, many server administrators choose to install both the EPEL and Remi repositories. These are not the only repositories available, but because they represent one of the most popular combinations, it is the purpose of this process to show you how both the EPEL and Remi repositories can be added to your system.
To Start With: What Do You Need?
To complete this process, you will require a working installation of the CentOS 7 operating system with root privileges, a console-based text editor of your choice, and a connection to the Internet in order to facilitate the download of additional packages.
The Process
Before we start, it is assumed that you have followed the previous process that showed you how to install and activate YUM priorities.
- To begin, log in as root and install the EPEL release repository using YUM:
yum install epel-release
- Next, from your home directory, type the following commands to download the remi release rpm package:
curl -O http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Note
Please note that, while you are reading this, this URL may have changed; if so, please do some Internet research to find out if there is a new URL available. - The preceding file should now be located in your home folder. To proceed, type the following command:
rpm -Uvh remi-release-7.rpm
- After the installation is done, open the Remi repository file with your favorite text editor:
vi /etc/yum.repos.d/remi.repo
- Change enabled=0 to enabled=1 and add the line priority=10 to the end of the [remi] section.
- Now, open the EPEL repository file with your favorite text editor:
vi /etc/yum.repos.d/epel.repo
- Again, change enabled=0 to enabled=1 if not set automatically and add the line priority=10 in the [epel] section.
- To finish, update YUM as shown here:
yum update
- If updates are available, choose Y to proceed. Having completed the update process, you will now be able to download and install packages from both the Remi and EPEL repositories as an addition to those that are used by default.
How it works...
In order to use and enjoy the benefits of a third-party repository, you are required to install and enable it first using the YUM and RPM package manager.
So, what did we learn from this experience?
Having started the process, the task of installing both the Remi and EPEL repositories is a remarkably smooth process. While the installation of the EPEL repository using YUM is very safe to changes, the preceding URL for Remi is maintained at the discretion of the repository owners, so you should always ensure that they are the most current. However, having obtained the necessary repository setup file, it was then a matter of applying an RPM-based command in order to install all necessary repository files on your system. Having done this, we were then required to open the relevant configuration files of each of the installed repositories and enable them (by changing enabled=0 to enabled=1) and setting a priority value (priority=10). While the former value will merely switch the repository on, the latter one will be used by YUM to correctly identify which repositories were the most appropriate when we called the update command. As it was discussed in the previous process regarding YUM priorities, the simple rule of thumb is based on remembering the phrase “the lower the number, the higher the priority.” This, in itself (depending on your reasons), may not be a bad thing to do, but for the purpose of this process, it is shown that the default CentOS repositories should take priority over all others. Of course, you may disagree with this, and yes, there is nothing stopping you from applying the same priority rule to a third-party supplier, but I do caution you before diving in, and this is particularly the case if this is for a mission-critical production server. Remember, if all the priority values are the same, then YUM will attempt to download the latest version by default.
The reason for setting both Remi and EPEL to a higher value than the existing CentOSbased repositories is based on the need to consider security updates. Unless you have determined otherwise, it is always advised that the base files should come from CentOS first. This includes, but it is not limited to, Kernel updates, SELinux, and related packages. Third-party repositories should be used for additional packages that cannot be obtained from the original sources, or for access to particular updates that may not be available to the base release of CentOS. This may include packages such as Apache, MariaDB, or PHP. As a final footnote, you will have noticed that both Remi and EPEL repositories shared the same priority value. This is by design as these repositories are often viewed as partners. However, if you decide to begin mixing repositories, or use this process as a gateway to installing other repositories not mentioned here, then you should always do your research and evaluate every third-party on a case-by-case basis. The Remi and EPEL repositories are very popular, so if you do intend to add more third-party resources, read around the subject, choose your repositories carefully, and stay loyal.
There's more…
There are many other interesting repositories available for CentOS 7, such as ELRepo, which focuses on hardware-related packages such as filesystem drivers, graphics drivers, network drivers, sound drivers, and webcam or video drivers. Go to http://elrepo.org to learn how to install and access it.