register & yum install
[root@localhost ~]# subscription-manager register --username 'MY_RHN_ID'
[root@localhost ~]# subscription-manager list --available --all >> /root/pool-list-all.txt
[root@localhost ~]# vi /root/pool-list-all.txt
[root@localhost ~]# subscription-manager attach --pool='POOL_ID'
[root@localhost ~]# ls -la /etc/yum.repos.d/redhat.repo
-rw-r--r-- 1 root root 5086 Oct 11 15:26 /etc/yum.repos.d/redhat.repo ---> created redhat.repo
[root@localhost ~]# yum repolist
[root@localhost ~]# subscription-manager repos --disable=*
[root@localhost ~]# subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms --enable=rhel-8-for-x86_64-appstream-rpms
[root@localhost ~]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: rhel-8-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/baseos/os
Enabled: 1
Repo ID: rhel-8-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Repo URL: https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/appstream/os
Enabled: 1
[root@localhost ~]# yum install 'packages'
unregister
[root@localhost ~]# subscription-manager remove --all
[root@localhost ~]# subscription-manager unregister
[root@localhost ~]# subscription-manager clean
All local data removed
[root@localhost ~]# ls -la /etc/yum.repos.d/
-> deleted redhat.repo
setup rhel subscription manager