How to enable ELRepo repository on CentOS or RHEL

Question: I would like to install a device driver from ELRepo on my CentOS box. How can I install and enable the ELRepo repository on [CentOS or RHEL]?

While CentOS/RHEL platforms maintain several official repositories (e.g., base, updates, contrib), they are lacking in terms of software coverage and release cycles. To bridge the gap between what is available and what is commonly needed, third-party repositories are created to serve community needs for commonly requested software packages.

One such third-party software repository for CentOS/RHEL is ELRepo (The Community Enterprise Linux Repository). ELRepo is actually one of few "community-approved" repositories due to its high maintenance quality.

What is ELRepo Repository?

ELRepo is especially well-known as a repository of hardware/device drivers and mainline kernel images for CentOS/RHEL. The repository carries a large number of the latest drivers for filesystems, graphics cards, network cards, sound cards, webcams, and displays. If you want to enhance your experience with various hardware devices in CentOS/RHEL-based enterprise Linux environment, it is recommended to enable ELRepo repository. ELRepo consists of the following four channels that you can enable separately.

  • elrepo: Offers packages not contained in CentOS/RHEL distributions. Enabled by default.
  • elrepo-kernel: Offers the LTS kernels and the latest stable kernels. Disabled by default.
  • elrepo-extras: Offers packages that replace or update CentOS/RHEL distributions. Disabled by default.
  • elrepo-testing: Offers packages that will soon move to elrepo. Disabled by default.

Enable ELRepo Repository on CentOS/RHEL

To set up ELRepo repository, you need to import its official GPG key and then install ELRepo RPM as follows.

On CentOS/RHEL 7:

$ sudo rpm --import
$ sudo rpm -Uvh

On CentOS/RHEL 6:

$ sudo rpm --import
$ sudo rpm -Uvh

On CentOS/RHEL 5:

$ sudo rpm --import
$ rpm -Uvh

Check the Content of ELRepo Repository

To verify ELRepo has been installed and enabled successfully, run the following:

$ yum repolist enabled

The output should indicate that elrepo (ELRepo's main channel) is enabled by default.

To see all available packages in the elrepo channel:

$ yum --disablerepo="*" --enablerepo="elrepo" list available

Similarly, to find a list of all available packages in the elrepo-kernel channel:

$ yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

Install Packages from ELRepo Repository

To install a package from ELRepo's main channel (which is enabled by default), simply use yum command as usual:

$ sudo yum install nvidia-x11-drv

Depending on packages, you may need to disable other non-elrepo repositories.

$ sudo yum --disablerepo="*" --enablerepo="elrepo" install nvidia-x11-drv

If you want to install a package from any other channel in ELRepo, you must explicitly enable it:

$ sudo yum --enablerepo="elrepo-kernel" install kernel-ml
Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

Leave a comment

Your email address will not be published. Required fields are marked *