What is the command 'rhn-channel' and how is it used?
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Network Classic
- Red Hat Satellite
Issue
- What is the command
rhn-channeland how is it used? - What is the command
spacewalk-channeland how is it used? - How to add channels to the system from the command line?
- Is it possible to use
rhn-channelandspacewalk-channelcommands supplying an encrypted password instead of plain text, or without entering a password?
Resolution
-
To use the command
rhn-channelorspacewalk-channelthe server must be registered. These commands let you register your server in secondary channels from the command line. These commands are provided by packagerhn-setup. -
It is not possible to use
rhn-channelandspacewalk-channelcommands to modify or list available channels without entering a password, or supplying an encrypted password instead of plain text. Howeverrhn-channel -lcan 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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
