DEBIAN_FRONTEND=noninteractive for Unattended apt
DEBIAN_FRONTEND=noninteractive tells debconf to accept defaults instead of prompting, which is required for unattended apt in CI.
The classic symptom is a Docker build that hangs while tzdata asks for a timezone. Setting this variable is the fix, but where you set it matters.
What it does
DEBIAN_FRONTEND selects the debconf frontend. The noninteractive value suppresses all prompts and uses package defaults, so tzdata, dialog, and similar packages install without stopping for input.
Common usage
# per-command (safest; does not leak into runtime)
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
# in a Dockerfile RUN (scoped to that RUN)
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && apt-get install -y --no-install-recommends tzdataOptions
| Value | What it does |
|---|---|
| noninteractive | No prompts; use defaults (use this in CI) |
| teletype | Minimal prompts, falls back to noninteractive-like |
| dialog | The interactive default (do not use in CI) |
In CI
Prefer prefixing the single apt-get command over a global ENV DEBIAN_FRONTEND in Docker, since a permanent ENV can confuse tools run later in the container. When you must set it globally, use ARG DEBIAN_FRONTEND=noninteractive so it does not persist into the final image.
Common errors in CI
A build that hangs on "Configuring tzdata" or "Please select the geographic area" means the variable is not set for that command. If prompts still appear, apt may be reading a Recommends that pulls in an interactive package; add --no-install-recommends. Setting it as a persistent ENV can later cause tools to misbehave, hence the per-command form.