From 7d4ecf9866ca7fb79e869a2b8a7194a1ebc8f0f5 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Tue, 18 Jun 2019 13:14:14 -0700 Subject: [PATCH] Tell apt-get to never ask questions It seems to be blocking waiting on user input for a couple packages now Fixes #379 --- tljh/apt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tljh/apt.py b/tljh/apt.py index d2c5fec..85d3f3a 100644 --- a/tljh/apt.py +++ b/tljh/apt.py @@ -43,8 +43,11 @@ def install_packages(packages): # Check if an apt-get update is required if len(os.listdir('/var/lib/apt/lists')) == 0: utils.run_subprocess(['apt-get', 'update', '--yes']) + env = os.environ.copy() + # Stop apt from asking questions! + env['DEBIAN_FRONTEND'] = 'noninteractive' utils.run_subprocess([ 'apt-get', 'install', '--yes' - ] + packages) + ] + packages, env=env)