How to remove repositories from Red Hat Satellite

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • WebGUI gives an error 'Red Hat repositories cannot be manipulated' and does not allow removal of the repository.

Resolution

  • Make sure the repository is not included in any published version of any Content View. If unsure or if it is present in either one, let follow this solution to identify the CV(s). Follow further steps even when the repo is removed from all CVs.

  • Using Satellite Command-line

  • Identity repository ID.

      # hammer repository list
    
  • Using foreman-rake console, check the repository ID & delete the repository. Replace REPO_ID.

      # foreman-rake console
      irb(main):001:0> Katello::Repository.find(REPO_ID)
      irb(main):002:0> Katello::Repository.find(REPO_ID).destroy
      irb(main):003:0> exit
    
  • Using Satellite Web UI

  • Try to remove the repository from the Satellite Web UI:

      Content -> Red Hat Repositories -> Enabled Repositories -> Disable  
    
      OR
    
      Content -> Product -> 'Product_name' -> Repository -> 'Repository_name' -> Select & Remove Repository
    

Root Cause

  • Satellite is not allowing the removal of Red Hat Repositories.

Diagnostic Steps

  • As example, run the below hammer command to remove capsule repositories from the Satellite server.

      [root@satellite ~]# hammer repository list | grep -i capsule
    
      ID  | NAME                                                  | PRODUCT                   | CONTENT TYPE
    

-|-|-|-

    287 | Red Hat Satellite Capsule 6.10                        | Red Hat Satellite Capsule | yum 

-|-|-|-

    [root@satellite ~]#  foreman-rake console
    irb(main):001:0> Katello::Repository.find(287)
    irb(main):002:0> Katello::Repository.find(287).destroy
    irb(main):003:0> exit
SBR
Product(s)
Components
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.