Run apt-get update before installing if required

This commit is contained in:
yuvipanda
2018-07-19 18:51:55 -07:00
parent e609a840c7
commit 6a1f73c2b5

View File

@@ -39,6 +39,9 @@ def install_packages(packages):
""" """
Install debian packages Install debian packages
""" """
# Check if an apt-get update is required
if len(os.listdir('/var/lib/apt/lists')) == 0:
subprocess.check_output(['apt-get', 'update', '--yes'])
subprocess.check_output([ subprocess.check_output([
'apt-get', 'apt-get',
'install', 'install',