我正在使用打包机 vsphere-iso
建造者使用 vSphere 构建 Ubuntu-18.04 VMshell
供应商,当我运行以下两个命令之一时:
sudo apt-get install software-properties-common --yes
sudo apt-get install ca-certificates curl gnupg lsb-release --yes
我收到以下错误:
==> vsphere-iso.ubuntu-18_04-base-template: debconf: unable to initialize frontend: Dialog
==> vsphere-iso.ubuntu-18_04-base-template: debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
==> vsphere-iso.ubuntu-18_04-base-template: debconf: falling back to frontend: Readline
==> vsphere-iso.ubuntu-18_04-base-template: debconf: unable to initialize frontend: Readline
==> vsphere-iso.ubuntu-18_04-base-template: 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.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7, <> line 31.)
==> vsphere-iso.ubuntu-18_04-base-template: debconf: falling back to frontend: Teletype
==> vsphere-iso.ubuntu-18_04-base-template: dpkg-preconfigure: unable to re-open stdin:
在 Google 上搜索该问题时,我发现很多人说设置DEBIAN_FRONTEND=noninteractive
可以修复该问题,包括在 Ask Ubuntu 上,但这并没有解决我的问题。
我知道我可以将错误传送到/dev/null
,但我宁愿不这样做,因为可能会发生破坏构建的错误。我实际上想阻止错误发生,例如设置DEBIAN_FRONTEND
为noninteractive
应该做的那样。
有谁知道如何解决这一问题?