This can be a real pain when automating things and you do an apt install and some packages ask a lot of questions.
Make sure you set this variable when running:
DEBIAN_FRONTEND=noninteractive
Remember as well that if chrooting you will want to run like this:
DEBIAN_FRONTEND=noninteractive apt install -y yourpackagename
debian, ubuntu, apt, install, daemon, default, promptingthis, automating, packages, variable, debian_frontend, noninteractive, chrooting, yourpackagename,