How to enable ELRepo repository on CentOS or RHEL

Last updated on August 9, 2020 by Dan Nanni

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.

Enable ELRepo Repository on CentOS or RHEL

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

On CentOS/RHEL 8:

$ sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
$ sudo rpm -Uvh https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

On CentOS/RHEL 7:

$ sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
$ sudo rpm -Uvh https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

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

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal (Credit Card) or Bitcoin (BTC Wallet: 1M161JGAkz3oaHNvTiPFjNYkeABox8rb4g).

Xmodulo © 2020 ‒ About ‒ Powered by DigitalOcean