I was using centOS8 and try to execute yum install -y gcc tcl
and failed. The error shows it has some problem with signature check or something at rpm install process.The console log is like
error: /var/cache/dnf/base-82351eca59c28538/packages/cpp-8.5.0-21.el8.x86_64.rpm: signature hdr data: BAD, no. of bytes(9088) out of range
and
Error: GPG check FAILED
.
I tried to upgrade my rpm installer and get same problem, and yum update
didn't work either. I tried to use --nogpgcheck
, it still didn't work.
2 Answers
You have two issues here:
1- error: /var/cache/dnf/base-82351eca59c28538/packages/cpp-8.5.0-21.el8.x86_64.rpm: signature hdr data: BAD, no. of bytes(9088) out of range
: there are multiple solutions for it:
- execute the following command
dnf clean all
- if the command above did not fix the issue: then follow the steps below:
curl ttps://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm -o centos-gpg-keys-8-3.el8.noarch.rpm
assuming you are using Centos 8 you can get the latest version of this by visiting the main website.rpm -i centos-gpg-keys-8-3.el8.noarch.rpm
(again if the version is different then you need to adjust the package name)
2- Error: GPG check FAILED
there are a couple of solutions for it.
sudo dnfclean all
,sudo yum clean metadata
, anddnf clean all
then rename/etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
then try to install your package again.- Disable
GPG check
temporarily if the solution above did not fix the issue - Check if you have a security application that might cause an issue such as Zscaler.
-
I indeed tried clean all command and still not function. I also tried to install local package here's my console log.
rpm -i rpm-build-4.14.3-31.el8.x86_64.rpm
error: rpm-build-4.14.3-31.el8.x86_64.rpm: signature hdr data: BAD, no. of bytes(16520) out of range error: rpm-build-4.14.3-31.el8.x86_64.rpm cannot be installed
Commented Jan 18 at 7:04 -
@Toxice_w_ try to rebuild RPM DB using the following command
sudo rpm --rebuilddb
Commented Jan 30 at 8:55
The bug is described here: https://bugzilla.redhat.com/show_bug.cgi?id=1896046
It is fixed in version rpm-4.14.3-12 and above, but because of the bug, a new version from the repo cannot be installed. You can manually download and install an earlier version like rpm-4.14.3-26.
First try if you can upgrade:
dnf upgrade rpm rpm-libs -y
If it does not work try the next steps:
Verify that you are using version 4.14.3, that has this issue:
# rpm --version
RPM version 4.14.3
If you have another version, do not continue with the next steps.
Download the older version of RPM and its libraries:
wget https://rpmfind.net/linux/centos/8-stream/BaseOS/$HOSTTYPE/os/Packages/rpm-4.14.3-26.el8.$HOSTTYPE.rpm
wget https://rpmfind.net/linux/centos/8-stream/BaseOS/$HOSTTYPE/os/Packages/rpm-libs-4.14.3-26.el8.$HOSTTYPE.rpm
Extract the RPM packages using rpm2cpio and cpio:
rpm2cpio rpm-4.14.3-26.el8.$HOSTTYPE.rpm | cpio -idmv -D / -u
rpm2cpio rpm-libs-4.14.3-26.el8.$HOSTTYPE.rpm | cpio -idmv -D / -u
Upgrade RPM using dnf:
dnf upgrade rpm rpm-libs -y
yum clean all
and then again try to install