RPMDB校验和无效-尝试在CentOS 7.2 Docker映像中安装gcc


9

所以我试图创建一个包含gcc的Docker镜像。

RUN yum -y install gcc在Dockerfile中运行命令。

它会下载软件包,直到最终尝试安装依赖项失败为止。

Rpmdb checksum is invalid: dCDPT(pkg checksums): glibc-headers.x86_64 0:2.17-157.el7_3.1 - u

以下是输出:

Dependencies Resolved

================================================================================
 Package              Arch         Version                  Repository     Size
================================================================================
Installing:
 gcc                  x86_64       4.8.5-11.el7             base           16 M
Installing for dependencies:
 cpp                  x86_64       4.8.5-11.el7             base          5.9 M
 glibc-devel          x86_64       2.17-157.el7_3.1         updates       1.1 M
 glibc-headers        x86_64       2.17-157.el7_3.1         updates       668 k
 kernel-headers       x86_64       3.10.0-514.6.2.el7       updates       4.8 M
 libgomp              x86_64       4.8.5-11.el7             base          152 k
 libmpc               x86_64       1.0.1-3.el7              base           51 k
 mpfr                 x86_64       3.1.1-4.el7              base          203 k
Updating for dependencies:
 glibc                x86_64       2.17-157.el7_3.1         updates       3.6 M
 glibc-common         x86_64       2.17-157.el7_3.1         updates        11 M
 libgcc               x86_64       4.8.5-11.el7             base           97 k

Transaction Summary
================================================================================
Install  1 Package  (+7 Dependent packages)
Upgrade             ( 3 Dependent packages)

Total download size: 44 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
--------------------------------------------------------------------------------
Total                                              2.3 MB/s |  44 MB  00:19     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : libgcc-4.8.5-11.el7.x86_64                                  1/14 
  Updating   : glibc-2.17-157.el7_3.1.x86_64                               2/14 
warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnew
error: lua script failed: [string "%triggerin(glibc-common-2.17-106.el7_2.6.x86_64)"]:1: attempt to compare number with nil
Non-fatal <unknown> scriptlet failure in rpm package glibc-2.17-157.el7_3.1.x86_64
  Updating   : glibc-common-2.17-157.el7_3.1.x86_64                        3/14 
  Installing : mpfr-3.1.1-4.el7.x86_64                                     4/14 
  Installing : libmpc-1.0.1-3.el7.x86_64                                   5/14 
  Installing : cpp-4.8.5-11.el7.x86_64                                     6/14 
  Installing : libgomp-4.8.5-11.el7.x86_64                                 7/14 
  Installing : kernel-headers-3.10.0-514.6.2.el7.x86_64                    8/14 
  Installing : glibc-headers-2.17-157.el7_3.1.x86_64                       9/14 
  Installing : glibc-devel-2.17-157.el7_3.1.x86_64                        10/14 
  Installing : gcc-4.8.5-11.el7.x86_64                                    11/14 
  Cleanup    : glibc-2.17-106.el7_2.6.x86_64                              12/14 
  Cleanup    : glibc-common-2.17-106.el7_2.6.x86_64                       13/14 
  Cleanup    : libgcc-4.8.5-4.el7.x86_64                                  14/14

Rpmdb checksum is invalid: dCDPT(pkg checksums): glibc-headers.x86_64 0:2.17-157.el7_3.1 - u

The command '/bin/sh -c yum -y install gcc' returned a non-zero code: 1

RUN touch /var/lib/rpm/*在安装yum之前添加此行。来源
dtmland

Answers:


9

创建Docker映像时遇到了这个确切的问题。首先安装yum-plugin-ovl,这是Docker overlay fs的yum插件,为我解决了此问题。

例:

... RUN yum -y update \ && yum -y install yum-plugin-ovl \ && yum -y install gcc ...

有关修复程序的更多信息,请参见此GitHub问题

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.