I tried to follow the instruction on a RHEL 8.5 system. The two sudos went well, but then the yum install epel-release failed with
[root@9850ba239af1 /]# yum install epel-release
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Red Hat Universal Base Image 8 (RPMs) - BaseOS 3.4 MB/s | 796 kB 00:00
Red Hat Universal Base Image 8 (RPMs) - AppStream 10 MB/s | 2.6 MB 00:00
Red Hat Universal Base Image 8 (RPMs) - CodeReady Builder 121 kB/s | 16 kB 00:00
No match for argument: epel-release
Error: Unable to find a match: epel-release
After some random research I found https://linuxconfig.org/redhat-8-epel-install-guide with the workaround: dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm.
After this, the rest of the install went well.
Not sure if it's a local problem or something with additional impact / cause.
(Disclaimer: I am not an expert at all with RHEL)