Skip to content

Wait for apt lists lock before update#5

Open
rjayasin wants to merge 1 commit into
mainfrom
claude/fix-apt-lists-lock-wait
Open

Wait for apt lists lock before update#5
rjayasin wants to merge 1 commit into
mainfrom
claude/fix-apt-lists-lock-wait

Conversation

@rjayasin
Copy link
Copy Markdown
Owner

Summary

  • DPkg::Lock::Timeout=-1 only blocks on the dpkg lock used by install/upgrade, not the apt lists lock taken by apt-get update. When unattended-upgrades runs its own apt-get update, ours still fails with Could not get lock /var/lib/apt/lists/lock.
  • Reintroduces a wait_for_apt helper that polls the relevant lock files via fuser and calls it before apt-get update. DPkg::Lock::Timeout still handles install/upgrade/autoremove.

Test plan

  • Run setup_linux.sh on a fresh Ubuntu box immediately after boot (while apt-daily/unattended-upgrades is still active) and confirm it waits instead of erroring out on the lists lock.
  • Run setup_linux.sh on an idle system and confirm no regression (no spurious waits, completes normally).

Generated by Claude Code

DPkg::Lock::Timeout only blocks on the dpkg lock used by install/
upgrade, not the apt lists lock taken by `apt-get update`. When
unattended-upgrades is running its own `apt-get update`, our update
still fails with "Could not get lock /var/lib/apt/lists/lock".

Reintroduce wait_for_apt and call it before `apt-get update`. The
DPkg::Lock::Timeout option still handles install/upgrade/autoremove.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants