OSETC TECH

How to Register Red Hat Subscription in RHEL 8

This post will guide you how to register and subscribe a system to the Red Hat Customer Portal using Red Hat Subscription-Manager in Red Hat Enterprise Linux 8. How do I register system to Red Hat Network to receive updates and install additional products in your RHEL 8 Linux.

Registering and Subscribe to Customer Portal


After installed RHEL 8 on your system, you need to register your RHEL 8 system to Red Hat Customer Portal, then attach a subscription for your registered system. Running the following command to register your system to red hat customer portal, type:

$ subscription-manager register

Outputs:

[root@localhost ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: Your-Red-Hat-Account-Name
Password: Your-Red-Hat-Account-password
The system has been registered with ID: 52e75927-973b-4e8e-bc75-be744bc77a48
The registered system name is: localhost

Note: before registering the system, you need to go to the official web site of Red Hat to create one account.

Then you can attach a subscription from any available that match the system. Type the following command to attach any available subscription that matches the current system:

$ subscription-manager attach --auto

Outputs:

[root@localhost ~]# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status: Subscribed

You can also register and automatically subscribe in one step to Red Hat Customer Portal, just use the following command to register your RHEL 8 system, and then automatically associate any available subscription matching your system:

$ subscription-manager register --username <username> --password <password> --auto-attach

Outputs:

[root@localhost ~]# subscription-manager register --username Your-Red-Hat-Account-Name --password Your-Red-Hat-Account-password --auto-attach
Registering to: subscription.rhsm.redhat.com:443/subscription
The system has been registered with ID: d00abe39-521d-466b-9ab0-5e9ce397198a
The registered system name is: localhost
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status: Subscribed

Check All Available Repositories


After registered the system and attach a subscription, you can check all available repositories with the following command:

$ yum repolist

or

$ dnf repolist

Outputs:

[root@localhost ~]# dnf repolist
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 1.6 kB/s | 4.1 kB 00:02
Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs) 1.6 kB/s | 4.1 kB 00:02
repo id repo name status
rhel-8-for-x86_64-appstream-beta-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 4,594
rhel-8-for-x86_64-baseos-beta-rpms Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs) 1,686

Installing a Package with Subscription Management repositories


After registered your system to Redhat Customer Portal, you can try to install a package on your RHEL 8 system. For example, you want to install wget package, just execute the following command:

$ dnf install wget

Outputs:

[root@localhost ~]# dnf install wget
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Last metadata expiration check: 0:04:07 ago on Thu 28 Mar 2019 10:01:42 AM EDT.
Dependencies resolved.
=====================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================
Installing:
wget x86_64 1.19.5-6.el8 rhel-8-for-x86_64-appstream-beta-rpms 733 k

Transaction Summary
=====================================================================================================================
Install 1 Package

Total download size: 733 k
Installed size: 2.8 M
Is this ok [y/N]: y
Downloading Packages:
wget-1.19.5-6.el8.x86_64.rpm 186 kB/s | 733 kB 00:03
---------------------------------------------------------------------------------------------------------------------
Total 184 kB/s | 733 kB 00:03
warning: /var/cache/dnf/rhel-8-for-x86_64-appstream-beta-rpms-64aba9de5ea7e089/packages/wget-1.19.5-6.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 3.1 kB/s | 3.3 kB 00:01
Importing GPG key 0xF21541EB:
Userid : "Red Hat, Inc. (beta key 2) <security@redhat.com>"
Fingerprint: B08B 659E E86A F623 BC90 E8DB 938A 80CA F215 41EB
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
Is this ok [y/N]: y
Key imported successfully
Importing GPG key 0x897DA07A:
Userid : "Red Hat, Inc. (Beta Test Software) <rawhide@redhat.com>"
Fingerprint: 17E8 543D 1D4A A5FA A96A 7E9F FD37 2689 897D A07A
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
Is this ok [y/N]: y
Key imported successfully
Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 3.1 kB/s | 3.1 kB 00:01
Importing GPG key 0xFD431D51:
Userid : "Red Hat, Inc. (release key 2) <security@redhat.com>"
Fingerprint: 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Key imported successfully
Importing GPG key 0x2FA658E0:
Userid : "Red Hat, Inc. (auxiliary key) <security@redhat.com>"
Fingerprint: 43A6 E49C 4A38 F4BE 9ABF 2A53 4568 9C88 2FA6 58E0
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installed: wget-1.19.5-6.el8.x86_64
Installing : wget-1.19.5-6.el8.x86_64 1/1
Running scriptlet: wget-1.19.5-6.el8.x86_64 1/1
Installed: wget-1.19.5-6.el8.x86_64
Verifying : wget-1.19.5-6.el8.x86_64 1/1

Installed:
wget-1.19.5-6.el8.x86_64

Complete!

Unregistering Red Hat Subscription


If you want to unregister your system from Red Hat Customer portal, and you need to remove all subscriptions from this registered system, then unregister your system, last, remove all local system and subscription data. just execute the following three commands:

$ subscription-manager remove --all
$ subscription-manager unregister
$ subscription-manager clean

Outputs:

[root@localhost ~]# subscription-manager remove --all
1 local certificate has been deleted.
1 subscription removed at the server.
[root@localhost ~]# subscription-manager unregister
Unregistering from: subscription.rhsm.redhat.com:443/subscription
System has been unregistered.
[root@localhost ~]# subscription-manager clean
All local data removed