What is the command 'rhn-channel' and how is it used?

Solution Verified - Updated -

Environment

Issue

  • What is the command rhn-channel and how is it used?
  • What is the command spacewalk-channel and how is it used?
  • How to add channels to the system from the command line?
  • Is it possible to use rhn-channel and spacewalk-channel commands supplying an encrypted password instead of plain text, or without entering a password?

Resolution

  • To use the command rhn-channel or spacewalk-channel the server must be registered. These commands let you register your server in secondary channels from the command line. These commands are provided by package rhn-setup.

  • It is not possible to use rhn-channel and spacewalk-channel commands to modify or list available channels without entering a password, or supplying an encrypted password instead of plain text. However rhn-channel -l can be used to list channels, with no username/password.

Command Options:

-c CHANNEL, --channel=CHANNEL - name of channel you want to (un)subscribe
-a, --add - subscribe to channel
-r, --remove - unsubscribe from channel
-l, --list - list subscribed channels
-L, --available-channels - list available channels
-v, --verbose - verbose output
-u USER, --user=USER - your user name
-p PASSWORD, --password=PASSWORD - your password

Please note -L, --available-channels is not available in Red Hat Enterprise Linux 5.

Examples:

Subscribe to a channel:

# rhn-channel --add --channel=<channel-name> --user=<rhn-username> --password=<rhn-password>
# rhn-channel -a -c <channel-name> -u <rhn-username> -p <rhn-password>

Unsubscribe from a channel:

# rhn-channel --remove --channel=<channel-name> --user=<rhn-username> --password=<rhn-password>
# rhn-channel -r -c <channel-name> -u <rhn-username> -p <rhn-password>

List all available child channels for your subscription. This is a new option available in Red Hat Enterprise Linux 6:

# rhn-channel -L -u <rhn-username> -p <rhn-password>

List the channels you are subscribed to:

# rhn-channel -l

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.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.