Persistent whonix-ws-16 update failure

I’m running into a persistent error when attempting to update whonix-ws-16 through the Qubes Update (GUI) tool.

I’m used to failed updates (https://forum.qubes-os.org/t/how-do-i-actually-update-qubes-os-v4-1). Normally, rebooting and trying again fixes update failures. However, I have tried several times to update whonix-ws-16 and keep running into the same error. See the Qubes Update output/details:

Updating whonix-ws-16

Error on updating whonix-ws-16: Command '['sudo', 'qubesctl', '--skip-dom0', '--targets=whonix-ws-16', '--show-output', 'state.sls', 'update.qubes-vm']' returned non-zero exit status 20.
whonix-ws-16:
  ----------
            ID: update
      Function: pkg.uptodate
        Result: False
       Comment: Problem encountered upgrading packages. Additional info follows:
                
                result:
                    ----------
                    pid:
                        2498
                    retcode:
                        100
                    stderr:
                        Running scope as unit: run-rd88b52d6b2154b3980e9dfc12b0ce3d2.scope
                        E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
                    stdout:
       Started: 05:14:23.952089
      Duration: 10522.294 ms
       Changes:   
  ----------
            ID: notify-updates
      Function: cmd.run
          Name: /usr/lib/qubes/upgrades-status-notify
        Result: True
       Comment: Command "/usr/lib/qubes/upgrades-status-notify" run
       Started: 05:14:34.476402
      Duration: 4102.783 ms
       Changes:   
                ----------
                pid:
                    2510
                retcode:
                    0
                stderr:
                stdout:
  
  Summary for whonix-ws-16
  ------------
  Succeeded: 1 (changed=1)
  Failed:    1
  ------------
  Total states run:     2
  Total run time:  14.625 s

Anyone else running into this or know how to fix it? The error message says “dpkg was interrupted”, but I don’t know why that would be. It also says “you must manually run ‘dpkg --configure -a’ to correct the problem”, but I would like for someone else to weigh in here before I attempt this and possibly screw something up - if fixing the issue is as simple as running that command, why am I being asked to do it?

If you are scared about breaking it (further) you can do:

  1. Copy your whonix-ws-16 Template to whonix-ws-16-backup
  2. Start whonix-ws-16
  3. Open a shell in the Template and run sudo dpkg --configure -a
  4. If it worked, you can delete the backup.

Why it broke? No idea. Sometimes something happens. Most likely it is nothing with security or anonymity implications.

Running " sudo dpkg --configure -a" did indeed fix this and allow to to install updates in whonix-ws-16 again. Not sure how it got into this state, however. I have a feeling that there was an internet connection interruption that caused this, but this would be pretty disappointing if that is the case, because any software updater should be smart enough to not attempt to make changes until all required files are downloaded and verified.

Most likely it was the connection.

It does try it a few times, but if it fails to connect to the repos it gives up.