How to access Optional and Supplementary channels, and -devel packages using Red Hat Subscription Management (RHSM)?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5.7 and newer
  • Red Hat Enterprise Linux 6.1 and newer
  • Red Hat Enterprise Linux 7
  • Certificate-based RHN via Red Hat Subscription Management (RHSM)

Issue

  • How to receive optional and supplementary content with my Red Hat Enterprise Linux subscription when using Certificate-based Red Hat Subscription Management
  • How to add the optional and supplementary channel with Subscription Management

Resolution

Command Line Interface (CLI) Method

When using Red Hat Subscription Manager (RHSM) and subscription-manager tooling, Optional and Supplementary repositories are provided but disabled by default (enabled=0 in /etc/yum.repos.d/redhat.repo).

Enabled repositories can be viewed by the following command:

# yum repolist

While all repositories can be viewed by the following command:

# subscription-manager repos --list
Using subscription-manager

The command subscription-manager repos --enable/disable can be used to enable a repository,

# subscription-manager repos --enable <channel_id>

For RHEL6:
# subscription-manager repos --enable rhel-6-server-optional-rpms

For RHEL7:
# subscription-manager repos --enable rhel-7-server-optional-rpms
Using yum-config-manager

The yum-config-manager command is provided by the yum-utils package RPM on RHEL6. It is not available on RHEL5.

You can enable repositories by running the following command:

# yum-config-manager --enable <channel_id>

For example:
# yum-config-manager --enable rhel-6-server-optional-rpms
Manually editing redhat.repo:

You can manually edit /etc/yum.repo.d/redhat.repo to set enabled=1 for the supplementary and optional channels.

  • RHEL5 redhat.repo:

    [rhel-5-server-supplementary]
    name = Red Hat Enterprise Linux 5 Server - Supplementary (RPMs)
    baseurl = https://cdn.redhat.com/content/dist/rhel/server/5/$releasever/$basearch/supplementary/os
    enabled = 1
    ...  
    [rhel-5-server-productivity-rpms]
    name = Red Hat Enterprise Linux 5 Server - Optional Productivity Applications (RPMs)
    baseurl = https://cdn.redhat.com/content/dist/rhel/server/5/$releasever/$basearch/productivity/os
    enabled = 1
    
  • RHEL6 redhat.repo:

    [rhel-6-server-supplementary]
    name = Red Hat Enterprise Linux 6 Server - Supplementary (RPMs)
    baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/supplementary/os
    enabled = 1
    ...
    [rhel-6-server-optional-rpms]
    name = Red Hat Enterprise Linux 6 Server - Optional (RPMs)
    baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/optional/os
    enabled = 1
    
Using yum --enablerepo

You can use a one time option such as:

# yum --enablerepo=rhel-6-server-optional-rpms install <package name>

The above will not permanently enable the channel in the redhat.repo, but will allow you to access packages in the channel in a one-off manner.

Graphical User Interface (GUI) Method:

To enable and disable repositories, use the Add/Remove Software application by navigating to:

System --> Administration --> Add/Remove Software

Next, within the Add/Remove Software window, select the System menu item and select Software Sources.

For RHEL7

To enable and disable repositories:

Applications --> System Tools --> Red Hat Subscription Manager

To add and remove packages:

Applications --> System Tools --> Software

SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.