upgrades: Allow grub-pc upgrade without reinstalling grub

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2020-12-24 13:48:46 -05:00 committed by Sunil Mohan Adapa
parent 6665052fe8
commit 092c7e70d1
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -11,7 +11,8 @@ import re
import subprocess
import sys
from plinth.action_utils import apt_hold, run_apt_command, service_restart
from plinth.action_utils import (apt_hold, debconf_set_selections,
run_apt_command, service_restart)
from plinth.modules.apache.components import check_url
from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST,
get_current_release, is_backports_current)
@ -392,7 +393,12 @@ def _perform_dist_upgrade():
run_apt_command(['install', 'base-files'])
run_apt_command(['install', 'unattended-upgrades'])
print('Running unattended-upgrade...')
# Tell grub-pc to continue without installing grub again.
print('Set grub-pc to not require re-installing grub...', flush=True)
debconf_set_selections(
['grub-pc grub-pc/install_devices_empty boolean true'])
print('Running unattended-upgrade...', flush=True)
subprocess.run(['unattended-upgrade', '--verbose'])
# Remove obsolete packages that may prevent other packages from