Install the container tools :
$ sudo dnf install buildah podman skopeo
Sign in to registry.redhat.io :
$ sudo podman login registry.redhat.io
Pull the RHEL 8 UBI image :
$ sudo podman pull registry.redhat.io/ubi8/ubi
Start the insights container :
$ sudo podman run --name insights --privileged -it registry.redhat.io/ubi8/ubi /usr/bin/bash
Install perl-JSON-PP & clean :
# dnf install perl-JSON-PP
# dnf clean all
# rm -r /var/cache/dnf
Get info about registered hosts :
# curl -k --user <username> https://cloud.redhat.com/api/inventory/v1/hosts | json_pp > /home/hosts.json
Check for the 'id' to get deleted :
# cat /home/hosts.json
Delete the non-existing system :
# curl -k --user <username> -X "DELETE" https://cloud.redhat.com/api/inventory/v1/hosts/<id>
Now exit the insights container :
# exit
Want to use the container again ?
$ sudo podman start --attach insights