The previous definition assigned a multi-word string to PKG_INSTALL:
PKG_INSTALL="DEBIAN_FRONTEND=noninteractive apt-get install -y"
Downstream generators expand it as '$PKG_INSTALL pkg…', which bash
parses as 'DEBIAN_FRONTEND=noninteractive apt-get install -y pkg…'
— the leading assignment is treated as a command name, producing
'DEBIAN_FRONTEND=noninteractive: command not found' (e.g. docker.sh
line 40). The DEBIAN_FRONTEND variable was also never set, so apt
could fall into interactive mode for tzdata / debconf prompts.
Fix: turn PKG_INSTALL into a shell function and export
DEBIAN_FRONTEND separately. All ~50 call sites keep the existing
$PKG_INSTALL pkg… syntax unchanged.
Verified: bash -n OK; mock Ubuntu 22.04 run exits 0 with no
'command not found'; mock apt-get receives the correct args.
All 44 generators still render successfully.