[Docker] docker build 建立映象檔時,出現 Rpmdb checksum is invalid 的錯誤訊息
Docker 雖然很方便,不過也還蠻常遇到奇怪的事情…
像之前一個可以用 docker build 建立完成的映象檔,
今天就突然失敗,一直出現 Rpmdb checksum is invalid 的錯誤訊息:
...... Step 7/68 : RUN yum -y install python-devel ---> Running in 1e12cdcaad54 ...... Running transaction Updating : 1:openssl-libs-1.0.2k-19.el7.x86_64 1/10 Updating : python-libs-2.7.5-88.el7.x86_64 2/10 Updating : python-2.7.5-88.el7.x86_64 3/10 Installing : python2-rpm-macros-3-32.el7.noarch 4/10 Installing : python-srpm-macros-3-32.el7.noarch 5/10 Installing : python-rpm-macros-3-32.el7.noarch 6/10 Installing : python-devel-2.7.5-88.el7.x86_64 7/10 Cleanup : python-2.7.5-16.el7.x86_64 8/10 Cleanup : python-libs-2.7.5-16.el7.x86_64 9/10 Cleanup : 1:openssl-libs-1.0.1e-42.el7.x86_64 10/10 Rpmdb checksum is invalid: dCDPT(pkg checksums): python-srpm-macros.noarch 0:3-32.el7 - u The command '/bin/sh -c yum -y install python-devel' returned a non-zero code: 1
上網查了一下,有人說可以安裝 yum-plugin-ovl 套件,
但是我用了這招,還是會出現錯誤:
yum -y install yum-plugin-ovl
後來是要在每一行 yum install 前面,都加上 rpm –rebuilddb 才能成功,
像是 debuginfo-install 這個指令也是用 yum install,
所以 debuginfo-install 前面也得加上 rem –rebuilddb 才行:
...... Step 7/68 : RUN rpm --rebuilddb; yum -y install python-devel ---> Running in 1e12cdcaad54 ...... Verifying : python-2.7.5-16.el7.x86_64 8/10 Verifying : python-libs-2.7.5-16.el7.x86_64 9/10 Verifying : 1:openssl-libs-1.0.1e-42.el7.x86_64 10/10 ...... Complete! ---> 60460ed58381
這樣雖然可以運作,不過實在不是很漂亮的解法,
希望之後可以找到一勞永逸的解法啊…
參考資料:
Docker中YUM安装RPM包报错 Rpmdb checksum is invalid: dCDPT(pkg checksums): …_kongxx的专栏-CSDN博客
Rpmdb checksum is invalid – Trying to install gcc in a CentOS 7.2 docker image – Unix & Linux Stack Exchange
(本頁面已被瀏覽過 597 次)