How to delete a Red Hat Base channel from Red Hat Satellite?

Solution Verified - Updated -

Environment

  • Red Hat Satellite 5.x

Issue

  • How to delete or remove Red Hat Base channels from Red Hat Satellite server ?
  • How to delete unused Red Hat Base channels from Red Hat Satellite server?
  • How to delete channel from Satellite ?

Resolution

RHN Satellite v5.3 and newer

The "spacewalk-remove-channel" utility can now be used to remove a software channel:

# /usr/bin/spacewalk-remove-channel -c channel_label

This command must be run as root on the same Satellite server from which the channel is being removed. If any systems are subscribed to that channel, the names of those systems are printed to standard output and the script exits without removing the channel. The --unsubscribe flag can be supplied on the command line to automatically unsubscribe those systems from the channel that is being removed. To use this command you need to have spacewalk-backend-tools-0.5.28-49 package on RHN Satellite server.

RHN Satellite v5.2 and older

As there is no such feature supported on RHN Satellite v5.2 and older versions, the following information has been provided by Red Hat, but is outside the scope of our posted Service Level Agreements (https://www.redhat.com/support/service/sla/) and support procedures. The information is provided as-is and any configuration settings or installed applications made from the information in this article could make your Operating System unsupported by Red Hat Support Services. The intent of this article is to provide you with information to accomplish your system needs. Use the information in this article at your own risk.

A script can be used to remove Red Hat provided channels from RHN Satellite. However, this script does not perform any checks, and its changes are not reversible. Therefore, it is extremely important to take precautions before performing this procedure.

The following pre-requisites must be met:

  1. Make sure the channel is not being used anymore. In particular:

    • There are no systems registered to the channel that is going to be deleted from the Satellite.

    • There are no kickstart profiles using the channel.

    • There are no activation keys defined that refer to the channel.

    • There are no custom channels or packages depending on the channel.

  2. Make a backup of the Satellite database. The procedure for performing database backups is documented on the Satellite Installation Guide.

   3.  The script that deletes channels is called satrm.py:

cd /usr/share/rhn
PYTHONPATH=/usr/share/rhn/ python satellite_tools/satrm.py -l
PYTHONPATH=/usr/share/rhn/ python satellite_tools/satrm.py --channel=channel-label

For example, to permanently remove the Red Hat Enterprise Linux 3 WS channel after making sure it is no longer in use:

cd /usr/share/rhn
PYTHONPATH=/usr/share/rhn/ python satellite_tools/satrm.py --channel=rhel-i386-ws-3

The following steps should be done after you run the sartm.py script:

  1. Stop your RHN satellite by  issuing "service rhn-satellite stop"
  2. Delete everything in "/var/cache/rhn", but keep "/var/cache/rhn/satsync"
  3. Start your RHN satellite by issuing "service rhn-satellite start"
  4. Resync the  RHN Satellite with RHN Network by issuing "satellite-sync"
  5. The metadata will now re-generated, depending on your hardware and the amount of channels, this can take quite some time. During this rebuild the RHN Satellite is not usable.
  6. Clean your yum caches on clients as needed.

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.