apt: Run dpkg --configure -a before other actions

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2020-06-24 20:36:13 -04:00 committed by Sunil Mohan Adapa
parent 5424e1e23f
commit 0f54fab067
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 2 additions and 0 deletions

View File

@ -94,6 +94,7 @@ def subcommand_install(arguments):
elif arguments.force_configuration == 'new':
extra_arguments += ['-o', 'Dpkg::Options::=--force-confnew']
subprocess.run(['dpkg', '--configure', '-a'])
with _apt_hold():
run_apt_command(['--fix-broken', 'install'])
returncode = run_apt_command(['install'] + extra_arguments +

View File

@ -84,6 +84,7 @@ def parse_arguments():
def subcommand_run(_):
"""Run unattended-upgrades"""
subprocess.run(['dpkg', '--configure', '-a'])
run_apt_command(['--fix-broken', 'install'])
try:
subprocess.Popen(['systemctl', 'start', 'freedombox-manual-upgrade'],