Skip to content

Instantly share code, notes, and snippets.

@phumpal
Created October 4, 2022 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phumpal/7de24663ab2d5af7505c9d0f7c5b81f6 to your computer and use it in GitHub Desktop.
Save phumpal/7de24663ab2d5af7505c9d0f7c5b81f6 to your computer and use it in GitHub Desktop.
unable to initialize frontend: Readline during Docker image build

When attempting to install packages after an apt-get update on >= Ubuntu 20.04 the previous work around of DEBIAN_FRONTEND=noninteractive no longer seems to work (think building Docker images)

debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
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/aarch64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/aarch64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/aarch64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype

Initial fix was to run

echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
apt-get -y --no-install-recommends install my_package_name

However for the sake of brevity adding a TZ env var seems to fix the existing line

DEBIAN_FRONTEND=noninteractive TZ=Utc apt-get install -y tzdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment