Introduction

After installing RHEL 8, we will need to attach this system to our RedHat subscription to be able to download and install software updates. In our last article, we explained step by step how to install RHEL 8 on a virtual machine. In this post, we will demonstrate how to subscribe our system to RedHat.

Before we get started let’s run the yum repolist command to verify that we don’t have any active subscriptions on the system.

[root@linuxnix ~]# yum repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
No repositories available
[root@linuxnix ~]#

The output says that we should use subscription-manager to register and that is exactly what we are going to do. To register your system with RedHat subscription Management, type the following command:

subscription-manager register --username your-redhat-developer-username --password your-password

Here the developer-username is the one we used to register with the RedHat developer program and download the RHEL 8 ISO. If the above-mentioned command succeeds then we should see some output similar to the one shown below.

Registering to: subscription.rhsm.redhat.com:443/subscription
The system has been registered with ID: df591e1b-43d1-43a8-99e4-38m1f17dbc52
The registered system name is: linuxnix
[root@linuxnix ~]#

Now that the system is registered, we need to attach it to our subscription with the following command.

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

To list the subscriptions our system is currently attached to we use the following command:

[root@linuxnix ~]# subscription-manager list
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux for x86_64
Product ID: 479
Version: 8.0
Arch: x86_64
Status: Subscribed
Status Details:
Starts: 08/15/2019
Ends: 08/14/2020
[root@linuxnix ~]#

Now let’s run the yum repolist command once again and observe the output.

[root@linuxnix ~]# yum repolist
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 1.2 MB/s | 8.7 MB 00:07
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 694 kB/s | 6.4 MB 00:09
Last metadata expiration check: 0:00:04 ago on Mon 19 Aug 2019 06:11:03 AM IST.
repo id repo name status
rhel-8-for-x86_64-appstream-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 5,759
rhel-8-for-x86_64-baseos-rpms Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 2,097
[root@linuxnix ~]#

As you could discern from the above output our system has two distinct repositories available to download packages from. AppStream is a new concept introduced in RHEL 8 wherein the userspace packages and the kernel space packages have been segregated into AppStream and BaseOS repositories respectively. We’ll discuss this in greater detail in a separate article.

To verify that we indeed can install packages from the repositories that we are registered to, let’s try to install the apache or httpd package.

[root@linuxnix ~]# yum install httpd
Updating Subscription Management repositories.
Last metadata expiration check: 0:07:52 ago on Mon 19 Aug 2019 06:11:03 AM IST.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
httpd x86_64 2.4.37-11.module+linuxnix.0.0+2969+90015743 rhel-8-for-x86_64-appstream-rpms 1.4 M
Installing dependencies:
apr x86_64 1.6.3-9.linuxnix rhel-8-for-x86_64-appstream-rpms 125 k
apr-util x86_64 1.6.1-6.linuxnix rhel-8-for-x86_64-appstream-rpms 105 k
httpd-tools x86_64 2.4.37-11.module+linuxnix.0.0+2969+90015743 rhel-8-for-x86_64-appstream-rpms 101 k
httpd-filesystem noarch 2.4.37-11.module+linuxnix.0.0+2969+90015743 rhel-8-for-x86_64-appstream-rpms 34 k
mod_http2 x86_64 1.11.3-2.module+linuxnix.0.0+2969+90015743 rhel-8-for-x86_64-appstream-rpms 156 k
redhat-logos-httpd noarch 80.7-1.linuxnix rhel-8-for-x86_64-baseos-rpms 25 k
Installing weak dependencies:
apr-util-openssl x86_64 1.6.1-6.linuxnix rhel-8-for-x86_64-appstream-rpms 27 k
apr-util-bdb x86_64 1.6.1-6.linuxnix rhel-8-for-x86_64-appstream-rpms 25 k
Enabling module streams:
httpd 2.4

Transaction Summary
==========================================================================================================================================================================
Install 9 Packages

Total download size: 2.0 M
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): apr-util-openssl-1.6.1-6.linuxnix.x86_64.rpm 10 kB/s | 27 kB 00:02
(2/9): apr-util-bdb-1.6.1-6.linuxnix.x86_64.rpm 7.2 kB/s | 25 kB 00:03
(3/9): apr-util-1.6.1-6.linuxnix.x86_64.rpm 94 kB/s | 105 kB 00:01
(4/9): apr-1.6.3-9.linuxnix.x86_64.rpm 29 kB/s | 125 kB 00:04
(5/9): httpd-filesystem-2.4.37-11.module+linuxnix.0.0+2969+90015743.noarch.rpm 41 kB/s | 34 kB 00:00
(6/9): httpd-tools-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64.rpm 64 kB/s | 101 kB 00:01
(7/9): mod_http2-1.11.3-2.module+linuxnix.0.0+2969+90015743.x86_64.rpm 157 kB/s | 156 kB 00:00
(8/9): redhat-logos-httpd-80.7-1.linuxnix.noarch.rpm 32 kB/s | 25 kB 00:00
(9/9): httpd-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64.rpm 815 kB/s | 1.4 MB 00:01
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 322 kB/s | 2.0 MB 00:06
warning: /var/cache/dnf/rhel-8-for-x86_64-appstream-rpms-9d3886b51bb367d7/packages/apr-util-openssl-1.6.1-6.linuxnix.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 779 kB/s | 5.0 kB 00:00
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 0xD4082792:
Userid : "Red Hat, Inc. (auxiliary key) <security@redhat.com>"
Fingerprint: 6A6A A7C9 7C88 90AE C6AE BFE2 F76F 66C3 D408 2792
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
Installing : apr-1.6.3-9.linuxnix.x86_64 1/9
Running scriptlet: apr-1.6.3-9.linuxnix.x86_64 1/9
Installing : apr-util-bdb-1.6.1-6.linuxnix.x86_64 2/9
Installing : apr-util-1.6.1-6.linuxnix.x86_64 3/9
Running scriptlet: apr-util-1.6.1-6.linuxnix.x86_64 3/9
Installing : apr-util-openssl-1.6.1-6.linuxnix.x86_64 4/9
Installing : httpd-tools-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64 5/9
Installing : redhat-logos-httpd-80.7-1.linuxnix.noarch 6/9
Running scriptlet: httpd-filesystem-2.4.37-11.module+linuxnix.0.0+2969+90015743.noarch 7/9
Installing : httpd-filesystem-2.4.37-11.module+linuxnix.0.0+2969+90015743.noarch 7/9
Installing : mod_http2-1.11.3-2.module+linuxnix.0.0+2969+90015743.x86_64 8/9
Installing : httpd-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64 9/9
Running scriptlet: httpd-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64 9/9
Verifying : apr-util-openssl-1.6.1-6.linuxnix.x86_64 1/9
Verifying : apr-util-bdb-1.6.1-6.linuxnix.x86_64 2/9
Verifying : apr-1.6.3-9.linuxnix.x86_64 3/9
Verifying : apr-util-1.6.1-6.linuxnix.x86_64 4/9
Verifying : httpd-tools-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64 5/9
Verifying : httpd-filesystem-2.4.37-11.module+linuxnix.0.0+2969+90015743.noarch 6/9
Verifying : mod_http2-1.11.3-2.module+linuxnix.0.0+2969+90015743.x86_64 7/9
Verifying : httpd-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64 8/9
Verifying : redhat-logos-httpd-80.7-1.linuxnix.noarch 9/9
Installed products updated.

Installed:
httpd-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64 apr-util-openssl-1.6.1-6.linuxnix.x86_64
apr-util-bdb-1.6.1-6.linuxnix.x86_64 apr-1.6.3-9.linuxnix.x86_64
apr-util-1.6.1-6.linuxnix.x86_64 httpd-tools-2.4.37-11.module+linuxnix.0.0+2969+90015743.x86_64
httpd-filesystem-2.4.37-11.module+linuxnix.0.0+2969+90015743.noarch mod_http2-1.11.3-2.module+linuxnix.0.0+2969+90015743.x86_64
redhat-logos-httpd-80.7-1.linuxnix.noarch

Complete!
[root@linuxnix ~]#
[root@linuxnix ~]# rpm -qi httpd
Name : httpd
Version : 2.4.37
Release : 11.module+linuxnix.0.0+2969+90015743
Architecture: x86_64
Install Date: Mon 19 Aug 2019 06:19:24 AM IST
Group : System Environment/Daemons
Size : 4512595
License : ASL 2.0
Signature : RSA/SHA256, Fri 05 Apr 2019 04:26:07 PM IST, Key ID 199e2f91fd431d51
Source RPM : httpd-2.4.37-11.module+linuxnix.0.0+2969+90015743.src.rpm
Build Date : Fri 05 Apr 2019 01:02:18 PM IST
Build Host : x86-vm-05.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor : Red Hat, Inc.
URL : https://httpd.apache.org/
Summary : Apache HTTP Server
Description :
The Apache HTTP Server is a powerful, efficient, and extensible
web server.
[root@linuxnix ~]#

If you wish to unregister your system for any reason then you could do so using the following command.

[root@linuxnix ~]# subscription-manager unregister
Unregistering from: subscription.rhsm.redhat.com:443/subscription
System has been unregistered.
[root@linuxnix ~]#
[root@linuxnix ~]# subscription-manager list
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux for x86_64
Product ID: 479
Version: 8.0
Arch: x86_64
Status: Unknown
Status Details:
Starts:
Ends:

Please note that the redhat developer subscription is valid for one year but could be renewed for free.

 

Conclusion

This concludes our post on how to register an RHEL 8 server with RedHat Subscription Management to download software. We hope that you’ve found this post to be useful and look forward to your suggestions and feedback.

The following two tabs change content below.

Sahil Suri

He started his career in IT in 2011 as a system administrator. He has since worked with HP-UX, Solaris and Linux operating systems along with exposure to high availability and virtualization solutions. He has a keen interest in shell, Python and Perl scripting and is learning the ropes on AWS cloud, DevOps tools, and methodologies. He enjoys sharing the knowledge he's gained over the years with the rest of the community.