To see the list of repo ids in pulp that are not in katello: # foreman-rake console > User.current = User.anonymous_admin > Katello.pulp_server.resources.repository.retrieve_all.map{|i| i['id']} - Katello::Repository.pluck(:pulp_id) - Katello::ContentViewPuppetEnvironment.pluck(:pulp_id) To remove said repositories > (Katello.pulp_server.resources.repository.retrieve_all.map{|i| i['id']} - Katello::Repository.pluck(:pulp_id) - Katello::ContentViewPuppetEnvironment.pluck(:pulp_id)).each{|pulp_id| Katello.pulp_server.resources.repository.delete(pulp_id)}