You are on page 1of 10

How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

Home Disclaimer Contact Archives About Subscribe Support

Advertise Search this site..

Search this site..

How-to guides OS Miscellaneous Certi�cation Preparations Tips & Tricks

Linux commands

You are here: Home / Howto

How to enable repository using subscription-manager in RHEL


Published: February 20, 2018 | Modi�ed: June 25, 2020

Learn how to enable repository using subscription-manager in RHEL. The article also includes steps to
register system with Red Hat, attach subscription and errors along with resolutions.

1 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

Home Disclaimer Contact Archives About Subscribe Support

Advertise

Enable repository using subscription-manager

In this article, we will walk you through step by step process to enable Red Hat repository in RHEL fresh
installed server.

The repository can be enabled using subscription-manager command like below –

root@kerneltalks # subscription-manager repos --enable rhel-6-server-rhv-4-agent-beta-debu


Error: 'rhel-6-server-rhv-4-agent-beta-debug-rpms' does not match a valid repository ID. U

You will see the above error when your subscription is not in place. Let’s go through step by step procedure
to enable repositories via subscription-manager

Step 1 : Register your system with Red Hat


We are considering you have a freshly installed system and it’s not yet registered with Red Hat. If you have a
registered system already then you can ignore this step.

You can check if your system is registered with Red Hat for the subscription using below command –

# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.18.10-1.el6
python-rhsm: 1.18.6-1.el6

Here, in the �rst line of output, you can see the system is not registered. So, let’s start with the registering
system. You need to use the subscription-manager command with register switch. You need to use your
Red Hat account credentials here.

2 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

root@kerneltalks # subscription-manager register


Registering
Home to: subscription.rhsm.redhat.com:443/subscription
Disclaimer Contact Archives About Subscribe Support
Username: admin@kerneltalks.com
Password:
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more
Advertise

If you are getting above error then your server is not able to reach RedHat. Check internet connection & if
you are able to resolve site names. Sometimes even if you are able to ping the subscription server, you will
see this error. This might be because you have the proxy server in your environment. In such a case, you
need to add its details in �le /etc/rhsm/rhsm.conf . Below proxy details should be populated :

# an http proxy server to use


proxy_hostname =

# port for http proxy server


proxy_port =

# user name for authenticating to an http proxy, if needed


proxy_user =

# password for basic http proxy auth, if needed


proxy_password =

Once you are done, recheck if subscription-manager taken up new proxy details by using below command

root@kerneltalks # subscription-manager config


[server]
hostname = [subscription.rhsm.redhat.com]
insecure = [0]
port = [443]
prefix = [/subscription]
proxy_hostname = [kerneltalksproxy.abc.com]
proxy_password = [asdf]
proxy_port = [3456]
proxy_user = [user2]
server_timeout = [180]
ssl_verify_depth = [3]

[rhsm]
baseurl = [https://cdn.redhat.com]
ca_cert_dir = [/etc/rhsm/ca/]
consumercertdir = [/etc/pki/consumer]
entitlementcertdir = [/etc/pki/entitlement]
full_refresh_on_yum = [0]
manage_repos = [1]
pluginconfdir = [/etc/rhsm/pluginconf.d]
plugindir = [/usr/share/rhsm-plugins]
productcertdir = [/etc/pki/product]
repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem
report_package_profile = [1]

3 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

[rhsmcertd]
Home Disclaimer Contact Archives About Subscribe Support
autoattachinterval = [1440]
certcheckinterval = [240]

Advertise
[logging]
default_log_level = [INFO]

[] - Default value in use

Now, try registering your system again.

root@kerneltalks # subscription-manager register


Registering to: subscription.rhsm.redhat.com:443/subscription
Username: admin@kerneltalks.com
Password:
You must first accept Red Hat's Terms and conditions. Please visit https://www.redhat.com

You will see the above error if you are adding the server to your Red Hat account for the �rst time. Go to the
URL and accept the terms. Come back to the terminal and try again.

root@kerneltalks # subscription-manager register


Registering to: subscription.rhsm.redhat.com:443/subscription
Username: admin@kerneltalks.com
Password:
The system has been registered with ID: xxxxb2-xxxx-xxxx-xxxx-xx8e199xxx

Bingo! The system is registered with Red Hat now. You can again verify it with version switch.

root@kerneltalks # subscription-manager version


server type: Red Hat Subscription Management
subscription management server: 2.0.43-1
subscription management rules: 5.26
subscription-manager: 1.18.10-1.el6
python-rhsm: 1.18.6-1.el6

Step 2: Attach subscription to your server


First, try to list repositories. You won’t be able to list any since we haven’t attached any subscription to our
server yet.

root@kerneltalks # subscription-manager repos --list


This system has no repositories available through subscriptions.

As you can see subscription-manager couldn’t found any repositories, you need to attach subscriptions to
your server. Once the subscription is attached, subscription-manager will be able to list repositories under
it.

4 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

To attach subscription, check all available subscriptions for your server with below command –
Home Disclaimer Contact Archives About Subscribe Support

root@kerneltalks # subscription-manager list --available


+-------------------------------------------+
Advertise
Available Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux for Virtual Datacenters, Standard
Provides: Red Hat Beta
Red Hat Software Collections (for RHEL Server)
Red Hat Enterprise Linux Atomic Host Beta
Oracle Java (for RHEL Server)
Red Hat Enterprise Linux Server
dotNET on RHEL (for RHEL Server)
Red Hat Enterprise Linux Atomic Host
Red Hat Software Collections Beta (for RHEL Server)
Red Hat Developer Tools Beta (for RHEL Server)
Red Hat Developer Toolset (for RHEL Server)
Red Hat Developer Tools (for RHEL Server)
SKU: RH00050
Contract: xxxxxxxx
Pool ID: 8a85f98c6011059f0160110a2ae6000f
Provides Management: Yes
Available: Unlimited
Suggested: 0
Service Level: Standard
Service Type: L1-L3
Subscription Type: Stackable (Temporary)
Ends: 12/01/2018
System Type: Virtual

You will get the list of such subscriptions available for your server. You need to read through what it
provides and note down Pool ID of subscriptions that are useful/required for you.

Now, attach subscriptions to your server by using pool ID.

root@kerneltalks # subscription-manager attach --pool=8a85f98c6011059f0160110a2ae6000f


Successfully attached a subscription for: Red Hat Enterprise Linux for Virtual Datacenters

If you are not sure which one to pick, you can simply attach subscriptions automatically which are best
suited for your server with below command –

root@kerneltalks # subscription-manager attach --auto


Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status: Subscribed

Move on to the �nal step to enable repository.

5 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

Step 3: Enable repository


Home Disclaimer Contact Archives About Subscribe Support
Now you will enable repository which is available under your attached subscription.

Advertise
root@kerneltalks # subscription-manager repos --enable rhel-6-server-rhv-4-agent-beta-debu
Repository 'rhel-6-server-rhv-4-agent-beta-debug-rpms' is enabled for this system.

That’s it. You are done. You can list repositories with yum command and con�rm.

⇠ Previous article Next article ⇢


How to boot SPYRUS WorkSafe Pro Linux2Go drive 12 useful zypper command examples

Related stu�:
• Highest size �les in mount point
• How to enter single user mode in SUSE 12 Linux?
• How to boot SPYRUS WorkSafe Pro Linux2Go drive
• How to disable GUI in SUSE Linux
• How to execute command inside Docker container
• How to add UUID entry in /etc/fstab in Linux
• bdf command formatted output in hpux
• How to convert JKS �le to KEY �le for Apache
• How to disable iptables �rewall temporarily
• How to remove product channels in Suse Manager
• 4 steps guide for SMTP con�guration in HPUX
• How to map Linux disk to vmware disk

If you like my tutorials and if they helped you in any way, then

• Consider buying me a cup of coffee via paypal!


• Subscribe to our newsletter here!
• Like KernelTalks Facebook page.
• Follow us on Twitter.
• Add our RSS feed to your feed reader.

Comments

6 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

Home Disclaimer Contact Archives About Subscribe Support


Ramkumar says
July 25, 2019 at 6:35 am
Advertise
you are fantastic, straight to the point. IT worked perfectly

Reply

mahesha says
September 23, 2020 at 1:38 pm

Do you need a paid redhat subscription for this?

Reply

Alexandre says
August 29, 2019 at 7:21 pm

Excellent, thanks for the contribution.

Reply

mahesha says
September 23, 2020 at 1:38 pm

Do you need a paid redhat subscription for this?

Reply

7 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

Home Disclaimer Contact Archives About Subscribe Support


Hansy says
April 20, 2021 at 8:59 pm
Advertise
Excellent, I followed your exact steps and was successful.
Thank you for your contribution! �

Reply

red hat employees says


July 25, 2021 at 10:36 am

Agent for Linux has been tested on Ubuntu 18.04, 19.10, Debian 10 and Linux Mint 19.3.

Other distributions might require further dependencies. Alternately, extra superior customers
with speci�c server needs should consider Debian. Who ought to use this:
ClearOS is a devoted Linux server operating.
In the same manner, use ‘cls’ for the primary argument for the class technique.
Documenting every technique with proper speci�cation of parameters,
return sort, and data types. All managed disks running Cloud PCs are encrypted, all
stored knowledge is encrypted at rest, and all network tra�c
to and from your Cloud PCs is also encrypted. Use tuples when data
is non-changeable, dictionaries when you want to map
things, and lists in case your data can change later on. This will not assist that a lot on a
pre-compiled Arch Linux kernel, since a decided attacker might simply download the kernel
bundle and get the symbols manually from there, but if you are compiling your personal kernel,
this may
also help mitigating native root exploits. In this text we are going to learn about a few of the
bene�ts of using
Amazon Web Services (AWS) and easy methods to dynamically create virtual machines (EC2) that
will help with these limitations in minutes.
One among the nice advantages of using EC2 is the
�nancial savings in administrative value, planning and funding in further-hardware that is
not necessary, which turns corporations large costs
into much smaller one.

8 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

Reply
Home Disclaimer Contact Archives About Subscribe Support

Advertise

ABKGOUD says
April 18, 2022 at 9:33 pm

im getting problem after this command “subscription-manager list –available”

saying “No available subscription pools to list”

Reply

Share Your Comments & Feedback:


Comment

Name * Email *

POST COMMENT

This site uses Akismet to reduce spam. Learn how your comment data is processed.

GET FRESH CONTENT FROM KERNELTALKS

9 of 10 02/01/2023 10:08
How to enable repository using subscription-manager in RHEL - Kernel... https://kerneltalks.com/howto/how-to-enable-repository-using-subscript...

Get Linux & Unix stu� right into your


Home Disclaimer Contact Archives About
mailbox. Subscribe
Subscribe Support
now!

* indicates required
Name
Advertise

Email Address *

SUBSCRIBE

This work is licensed under a CC-BY-NC license · Privacy Policy


© Copyright 2016-2021 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or o�ine without prior
permission.

10 of 10 02/01/2023 10:08

You might also like