Error When Trying to Update Template

Updating whonix-gateway-17

Traceback (most recent call last):
  File "/run/qubes-update/agent/entrypoint.py", line 98, in <module>
Refreshing package info
    sys.exit(main())
             ^^^^^^
  File "/run/qubes-update/agent/entrypoint.py", line 28, in main
    return_code = pkg_mng.upgrade(refresh=not args.no_refresh,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/common/package_manager.py", line 57, in upgrade
    result = self._upgrade(
             ^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/common/package_manager.py", line 94, in _upgrade
    result_refresh = self.refresh(hard_fail)
                     ^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/apt/apt_api.py", line 56, in refresh
    self.wait_for_lock()
  File "/run/qubes-update/agent/source/apt/apt_cli.py", line 55, in wait_for_lock
    with self.apt_lock():
  File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/apt/apt_cli.py", line 47, in apt_lock
    with open("/var/lib/apt/lists/lock", "rb+") as f_lock:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/apt/lists/lock'

Updating whonix-workstation-17
Refreshing package info
Traceback (most recent call last):
  File "/run/qubes-update/agent/entrypoint.py", line 98, in <module>
    sys.exit(main())
             ^^^^^^
  File "/run/qubes-update/agent/entrypoint.py", line 28, in main
    return_code = pkg_mng.upgrade(refresh=not args.no_refresh,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/common/package_manager.py", line 57, in upgrade
    result = self._upgrade(
             ^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/common/package_manager.py", line 94, in _upgrade
    result_refresh = self.refresh(hard_fail)
                     ^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/apt/apt_api.py", line 56, in refresh
    self.wait_for_lock()
  File "/run/qubes-update/agent/source/apt/apt_cli.py", line 55, in wait_for_lock
    with self.apt_lock():
  File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/run/qubes-update/agent/source/apt/apt_cli.py", line 47, in apt_lock
    with open("/var/lib/apt/lists/lock", "rb+") as f_lock:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/apt/lists/lock'
1 Like

Already reported at qubes-vm-update fails on freshly installed whonix template · Issue #9857 · QubesOS/qubes-issues · GitHub

2 Likes

Beside rushing to mark a topic as “Already reported” and “Closed”, what are the actual steps that user can do? I have dom0 updated and still get this same error.

1 Like

This seems to apply to new installs.

My guess is that at this point if you update dom0, then reinstall the templates from the template manager, then update the templates it should work, since this issue is on gitup and it probably got patched through a dom0 update. You could also check the testing repo for dom0 if it doesn’t work with a non-testing repo.

I forget what I did to resolve this, possibly this. I don’t think I did a fresh reinstall but perhaps I did that too. It’s hard to know.

1 Like