There’s a bug in rpm on Red Hat Enterprise Linux as well as some versions of CentOS Stream that can stop packages from installing. (Convenient, right?) You’ll see messages such as signature hdr data BAD when trying to upgrade packages via dnf.
This is how I ended up solving it:
- I’d try to upgrade 
rpmin place viadnfusingdnf upgrade rpm. This would fail, but it would cache the packages. - Note the path to the cached packages. On my system, it was 
/var/cache/dnf/baseos-9a27fc7471a8d219/packages/, but yours may vary. - Use 
rpmto force install therpmandrpm-libspackages:rpm -i --force /var/cache/dnf/baseos-9a27fc7471a8d219/packages/rpm-4.14.3-26.el8.x86_64.rpmrpm -i --force /var/cache/dnf/baseos-9a27fc7471a8d219/packages/rpm-libs-4.14.3-26.el8.x86_64.rpm
 - Then, try your 
dnf installordnf upgradeprocedure again, and it should be fine.