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