Deleting RPMs from Hummingbird Repos

How to delete RPM packages from Hummingbird repositories

Overview

  • This document should be used to remove RPMs from the Hummingbird repositories

Setup

  • make sure you have followed the local development setup instructions in the infrastructure repository
  • install pulp cli via dnf install pulp-cli
  • setup the local pulp environment via:
cki_secret PULP_PUBLIC_RHEL_PRIMITIVES_CONFIG_FILE  > ~/.config/pulp/cli.toml
# or
vault kv get -mount=apps -field cli.toml hummingbird/PULP_PUBLIC_RHEL_PRIMITIVES_CONFIG_FILE > ~/.config/pulp/cli.toml

Steps

  • Note the names of the rpms to delete. In this example, we’ll use systemd-stub
  • Obtain the relevant metadata required to delete.
    • You need to execute this command once for each architecture.
pulp --domain public-hummingbird rpm repository content list --repository aarch64 --limit  1000 | jq -r '.. | objects | select(.name=="systemd-stub" and has("pulp_href")) | .pulp_href'

Example output:

/api/pulp/public-hummingbird/api/v3/content/rpm/packages/019b0e50-b89e-749b-a82b-405e00cdd1ed/
/api/pulp/public-hummingbird/api/v3/content/rpm/packages/019b0ded-4234-72b6-82e2-36803fc57a3b/
  • Using the hrefs, construct your delete commands:
pulp --domain public-hummingbird rpm repository content remove --repository aarch64 --package-href /api/pulp/public-hummingbird/api/v3/content/rpm/packages/019b0e50-b89e-749b-a82b-405e00cdd1ed/
pulp --domain public-hummingbird rpm repository content remove --repository aarch64 --package-href /api/pulp/public-hummingbird/api/v3/content/rpm/packages/019b0ded-4234-72b6-82e2-36803fc57a3b/