Do not run apt update in dry-run mode

update requires root access to the machine and there is no --simulate
option so skip it in dry-run mode.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
This commit is contained in:
Jean-Baptiste Lallement 2022-04-07 10:54:18 +02:00
parent 3deddf76ed
commit 9ff8e10ef5
1 changed files with 4 additions and 3 deletions

View File

@ -186,6 +186,7 @@ class ConfigureController(SubiquityController):
log.error('Failed to detect recommended language packs.')
return False
if not self.app.opts.dry_run:
cp = await arun_command([aptCommand, "update"], env=env)
if cp.returncode != 0:
log.debug("Failed to update apt cache.\n%s", cp.stderr)