Thursday, April 30, 2020

How to enable or disable Red Hat Subscription-Manager in RHEL Linux

Red Hat Subscription-Manager, RHEL-Subscription-Manager

How to enable or disable Red Hat Subscription-Manager in Red Hat Linux

Post installation of Red Hat Linux 8.x, we need to subscribe the system with Red Hat Subscription Management (RHSM) to get updates, support, bug fixes etc. If you want to install a package which is not installed with DNF or YUM command. You may get messages "this system is not registered to Red Hat subscription management." To overcome this we have decided to write a small article on this topic, we are going to demo how to use Red Hat subscription-manager to manage your subscriptions and repository thru command line.
. How to Create an Apache-based YUM/DNF Repository on CentOS and RedHat Linux 8
Prerequisites:
a. Sudo or root privilege for normal user.
b. Need to provide firewall access for subscription.rhsm.redhat.com on port 443
c. Red Hat Active Subscription User Id and Password.
Following are the advantage of Red Hat subscription. 
  1. Support
  2. Bug Fixes
  3. Updates & upgrades
  4. 24*7 Technical Support
  5. Hardware and Software certifications
  6. Customer portal
  7. KB aka Knowledgebase, which is a document by Red Hat.
Also Read: Red Hat Enterprise Linux 8.1 Installation with Screenshots

Register with Red Hat Subscription Management (RHSM)

Step 1Register with Red Hat Subscription Management (RHSM)
# subscription-manager register --username <username> --password <password>  --auto-attach
(Click on picture to enlarge it)

Step 2: This will show the available subscription where you will get a Pool ID.
# subscription-manager list --available
(Click on picture to enlarge it)

Step 3: Subscription Manager attach with Pool ID as below.
# subscription-manager attach --pool=8a85f9815e032c14015e03a3dbcf2b77
Step 4: Use DNF or YUM command to update repository.
# dnf repolist

Step 5: List all the available repository in your account.
# subscription-manager repos --list
(Click on picture to enlarge it)

Step 6: Enable or disable particular RepoID and enable and disable all RepoID.
# subscription-manager repos --enable=rhel-8-for-x86_64-supplementary-rpms
# subscription-manager repos --enable=*
# subscription-manager repos --disable=*
# subscription-manager repos --disable=rhel-8-for-x86_64-supplementary-rpms
(Click on picture to enlarge it)

If we do --enable=* as shown in the above command which will enable all available repositories. And same can be verified in file /etc/yum.repos.d/redhat.repo where against the each repo entry enable = 1 would be present. Similarly, if you do --disable=* as shown in above command that enable = 0 would be seen in the redhat.repo file.
Step 7: How to unregister from RHSM
From this step we will see how to remove or unregister from Red Hat Subscription Management (RHSM). Remove Pool ID from Red Hat Subscription Management (RHSM) (Click on picture to enlarge it).
# subscription-manager remove --pool=8a85f9815e032c14015e03a3dbcf2b77

Step 8: Unregister from Red Hat Subscription Management (RHSM). 
With below command will remove all the repositories from local system (Click on picture to enlarge it).
# subscription-manager unregister
# subscription-manager clean

Conclusion: In this post we have seen How to enable or disable Red Hat Subscription-Manager in Red Hat Linux. Big thanks for reading all the way to the end. Please share it with Your Friends & Help Someone... and also Like Our Facebook Page. Let me hear your thoughts in the comments below!

No comments:

Post a Comment

Please do not enter any spam link in the comment box.