centos 用dnf 命令安装包的时候出现包签名错误

报错信息
[root@localhost]# dnf install git
CentOS-8 - AppStream 388 kB/s | 4.4 kB 00:00
CentOS-8 - Base 3.7 kB/s | 3.9 kB 00:01
CentOS-8 - Extras 376 kB/s | 2.9 kB 00:00
Dependencies resolved.

Package Architecture Version Repository Size

Installing:
git x86_64 2.39.3-1.el8 AppStream 104 k
Installing dependencies:
git-core x86_64 2.39.3-1.el8 AppStream 11 M
git-core-doc noarch 2.39.3-1.el8 AppStream 3.3 M
perl-Error noarch 1:0.17025-2.el8 AppStream 46 k
perl-Git noarch 2.39.3-1.el8 AppStream 79 k
perl-TermReadKey x86_64 2.37-7.el8 AppStream 40 k

Transaction Summary

Install 6 Packages

Total download size: 14 M
Installed size: 44 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): git-2.39.3-1.el8.x86_64.rpm 1.9 MB/s | 104 kB 00:00
(2/6): perl-Error-0.17025-2.el8.noarch.rpm 1.6 MB/s | 46 kB 00:00
(3/6): perl-Git-2.39.3-1.el8.noarch.rpm 1.3 MB/s | 79 kB 00:00
(4/6): perl-TermReadKey-2.37-7.el8.x86_64.rpm 954 kB/s | 40 kB 00:00
(5/6): git-core-doc-2.39.3-1.el8.noarch.rpm 700 kB/s | 3.3 MB 00:04
(6/6): git-core-2.39.3-1.el8.x86_64.rpm 1.4 MB/s | 11 MB 00:07

Total 1.8 MB/s | 14 MB 00:07
error: /var/cache/dnf/AppStream-91699f31f6595bcf/packages/git-core-2.39.3-1.el8.x86_64.rpm: signature hdr data: BAD, no. of bytes(59520) out of range
error: /var/cache/dnf/AppStream-91699f31f6595bcf/packages/git-core-doc-2.39.3-1.el8.noarch.rpm: signature hdr data: BAD, no. of bytes(294284) out of range
Problem opening package git-core-2.39.3-1.el8.x86_64.rpm
Problem opening package git-core-doc-2.39.3-1.el8.noarch.rpm
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing ‘dnf clean packages’.
Error: GPG check FAILED

尝试了几种方法都不行
1.dnf clean packages/all
2.使用–nogpgcheck 参数 dnf install git --nogpgcheck
3.修改CentOS-Base.repo中的gpgcheck参数为0 ,然后重新import gpgkey
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
再把gpgchekc改成1,最后重新安装dnf install git

正确的解决方式:
dnf update rpm

dnf update

参考原因

This is coming from the fact that when you create a new CentOS Droplet and then try to update it with the dnf or yum update command you are updating the rpm package as well causing differences in the rpm version trying to unpackage rpm files thus coming with an error like :

Problem opening package linux-firmware-20230217-113.git83f1d778.el8.noarch.rpm
I’ve reported this however for the time being what you can do is to update rpm alone and then do the dnf update on all packages;

centos yum/dnf 命令安装报错 Error: GPG check FAILED相关推荐

  1. 安装RPM时报错Error: GPG check FAILED

    1. 问题描述 需要安装mysl及其连接器.但安装mysql-8.0.26后,在安装mysql-connector-java时报错,错误日志如下误: [SKIPPED] mysql-connector ...

  2. blast2go centos mysql 5.7++ 安装报错ERROR 1819 (HY000) at line 4

    1)解决导入数据mysql -uroot -p passwd <b2gdb.sql 报错ERROR 1819 (HY000) at line 4: Your password does not ...

  3. npm安装报错Error: EPERM: operation not permitted解决方案

    电脑重装系统后重新配置环境安装node后,npm命令安装报错 Error: EPERM: operation not permitted npm ERR! code EPERM npm ERR! sy ...

  4. centos使用yum命令安装报错 File /usr/bin/yum, line 30 except KeyboardInterrupt, e:

    原因 centos7使用yum命令安装报错如下: File "/usr/bin/yum", line 30except KeyboardInterrupt, e:^ SyntaxE ...

  5. Redis 2.8.18 安装报错 error: jemalloc/jemalloc.h: No s

    2019独角兽企业重金招聘Python工程师标准>>> 本文为大家讲解的是Redis 2.8.18 安装报错 error: jemalloc/jemalloc.h: No such ...

  6. MongoDB启动报错 ERROR: child process failed, exited with 1

    1.启动报错 ERROR: child process failed, exited with 1 2.报错的原因 使用kill关闭进程导致的错误 3.解决 3.1.进入data中的目录,删除lock ...

  7. ArcGIS安装报错 Error: Error 1935: An error occurred during the installation of assembly

    缘起 帮客户安装ArcGIS,报错Error: Error 1935: An error occurred during the installation of assembly,然后查资料说让卸载. ...

  8. 2021-10-24 CMake安装报错Error when bootstrapping CMake: Cannot find appropriate C compiler on this syst

    一.报错 Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please speci ...

  9. docker windows 安装 报错 Component CommunityInstaller.AutoStartAction failed: 尝试执行未经授权的操作

    问题描述: docker windows 版本安装报错. Component CommunityInstaller.AutoStartAction failed: 尝试执行未经授权的操作. 详细报错: ...

  10. yum安装报错Error:Nothing to do

    报错信息 No package nginx available Error:Nothing to do 解决办法 : 方法一. 更换源 备份 mv /etc/yum.repos.d/CentOS-Ba ...

最新文章

  1. java--内存管理的几点小技巧
  2. 【数学和算法】初识卡尔曼滤波器(二)
  3. python开发中遇到的难题_初学者在Python开发中常见的问题(上)
  4. 如何选择bfs和dfs
  5. wampserver3.2.0_MySQL 8.0 技术详解
  6. 【转】VO BO PO 介绍
  7. exchange实现外部邮件收发的两种方法
  8. 蓝宝石rx580怎么超频_台式机显卡怎么选?小百科教你准确定位合理选择(3)
  9. php通过post请求_php代码post请求
  10. 《设计模式沉思录》—第2章2.4节访问权限
  11. 年轻设计师之于《未来产品的设计》
  12. 统一沟通-技巧-10-Lync-公网证书-Go Daddy-Buy
  13. CTD数据库(Comparative Toxicogenomics Database)介绍与使用
  14. 数学建模matlab题型,数学建模题型之分类
  15. AD9173/AD9689 FMC采集板卡调试记录
  16. 计算机美化标题教案,计算机基础教案标题.doc
  17. 高分辨率 java_高分辨率图像快照,在Java
  18. UVa 10934 Dropping water balloons:dp(递推)
  19. 通过guest账户无法进入远程计算机,小经验|guest远程关机设置
  20. Declare and Definition

热门文章

  1. Html利用Canvas绘制图形
  2. 夜光带你走进软件工程(十七)
  3. 一文带你了解:刚哥谈架构 (五) 谈谈数据库架构
  4. 编程判断俩个链表是否相交
  5. 如何在论文中优雅的插入代码
  6. 通信值勤维护管理条例_探究关于军队强化通信管理装备论文
  7. 2023年施工升降机司机(建筑特殊工种)证模拟考试题库及施工升降机司机(建筑特殊工种)理论考试试题
  8. hdu 1004 让气球飞 (map)
  9. 如何简单快速搭建 Android 大仓
  10. Android全面的屏幕适配方案解析(三)