Debian错误Can't locate Term/ReadLine.pm

最近在构建Docker镜像时,总是失败在Can't locate Term/ReadLine.pm,日志如下

Get:1 http://deb.debian.org/debian bullseye/main amd64 openssl amd64 1.1.1k-1+deb11u1 [851 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 ca-certificates all 20210119 [158 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 1009 kB in 25s (41.2 kB/s)
Selecting previously unselected package openssl.
(Reading database ... 6772 files and directories currently installed.)
Preparing to unpack .../openssl_1.1.1k-1+deb11u1_amd64.deb ...
Unpacking openssl (1.1.1k-1+deb11u1) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../ca-certificates_20210119_all.deb ...
Unpacking ca-certificates (20210119) ...
Setting up openssl (1.1.1k-1+deb11u1) ...
Setting up ca-certificates (20210119) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Updating certificates in /etc/ssl/certs...
129 added, 0 removed; done.
Processing triggers for ca-certificates (20210119) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Removing intermediate container a19d55490057
 ---> d439938bfcf5
Step 9/10 : COPY --from=0 /usr/src/myapp/target/release/sso .
invalid from flag value 0: No such image: sha256:d31713282fd49b05c2c5488678d25fc936b2abdde33bf4e71c869adbb419944f
Build step 'Execute shell' marked build as failure
Sending e-mails to: lizhong@uino.com
Finished: FAILURE
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: command terminated with exit code 1

因为关键配置没有变更过,突然出现这么一个错误有点没头绪,以为是网络原因某些依赖没有安装成功,结果多试几次之后就发现好像没那么简单,仔细看了一下安装过程,发现多出了一个Term/ReadLine的依赖包,解决方法就是在安装ca-certificates包之前,先把libterm-readkey-perl包给安装了

apt install libterm-readkey-perl -y

这么配置之后,问题解决。

分享

TITLE: Debian错误Can't locate Term/ReadLine.pm

LINK: https://www.qttc.net/546-debian-cant-locate-term-readline-pm.html

NOTE: 原创内容,转载请注明出自琼台博客