Fix Error: there are no enabled repositories in “/etc/yum.repos.d”, “/etc/yum/repos.d”, “/etc/distro.repos.d”
Solution for the error:
Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d"
This occurs when you have not enabled your RHEL subscription in your RedHat Linux.
Fix Error: there are no enabled repositories in “/etc/yum.repos.d”, “/etc/yum/repos.d”, “/etc/distro.repos.d”.
Without any further explanations, let’s have a look at the solution. As we know that the error is because the RHEL subscription is not being enabled. In this tutorial, we will take you through the step-by-step instructions to fix the “There are no enabled repositories RHEL solution” error.
How To Fix there are no enabled repositories RHEL solution error
We will do the following steps to fix this error.
- Register your RHEL subscription
- Enable the package manager
Enable Red Hat repositories with subscription-manager
command
First, you need to have a paid or trial Redhat subscription available. With a RedHat subscription, you can enable repos and install the software.
# subscription-manager register
Enable Red Hat repositories without a RedHat subscription
In this step, you need to mount your ISO image of RedHat and make it your local repository with the following command.
# mkdir /media/rhel-iso # mount /dev/cdrom /media/rhel-iso/
Now you need to create a new dnf repo file at /etc/yum.repos.d/RHEL_Disc.repo
with the following content:
[RHEL_Disc] name=rhel-8.4-x86_64-dvd baseurl="file:///media/rhel-iso/AppStream/" gpgcheck=0
Now check for new repos to enable this repository:
# dnf repolist
Now, you can easily install any software from repos without going through the error like Error: there are no enabled repositories in “/etc/yum.repos.d”, “/etc/yum/repos.d”, “/etc/distro.repos.d”.