lxd: wait on lock files before running apt commands
Metadata
Current evaluation
Merged a change that waits for apt lock files before executing apt commands in LXD. This prevents concurrent lock errors when apt runs simultaneously with snapcraft. Approved by two reviewers with a 12/-3 line diff.
Suggested action: —
No scores available.
Issue body
Avoid this error when a cron job (or user) runs apt-get at the same time as snapcraft:
Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
This is the same trick as employed in [#1421](https://github.com/snapcore/snapcraft/pull/1421)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a change that waits for apt lock files before executing apt commands in LXD. This prevents concurrent lock errors when apt runs simultaneously with snapcraft. Approved by two reviewers with a 12/-3 line diff. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix that waits for apt lock files before executing package commands in LXD. This prevents concurrent execution errors when apt runs simultaneously with snapcraft, applying the same synchronization method as PR #1421. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix making LXD wait on apt lock files before package commands. This prevents concurrent apt-get operations from failing with resource unavailable errors, reusing the synchronization approach from PR #1421. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1421 ci: wait for apt/dpkg lock when setting lxd up | snapcraft | merged | Merged a CI fix that waits for the apt/dpkg lock during LXD setup. Resolves permission denied errors during apt-get update by preventing concurrent package manager access. Approved by two reviewers and passed all checks. | |
| #2098 lxd: wait for on-going refreshes to finish | snapcraft | merged | Merged fix adding a snap watch call before injecting snaps into LXD containers to wait for ongoing refreshes. Resolves race conditions causing build failures in issues #2037 and LP: #1722049. Approved by reviewer and passed CI. | |
| #1577 lxd: don't inject local snaps on a different arch | snapcraft | merged | Merged a fix preventing Snapcraft from injecting local snaps into LXD containers with mismatched architectures. Cross-arch remotes now install snaps from the store. Approved by reviewers and merged after CI checks. | |
| #1984 fix(snap): check if LXD is actually installed | charmcraft | merged | Merged fix updating configure and remove hooks to verify LXD installation before proceeding. Prevents unwanted LXD snap installations on Ubuntu that cause delays. Approved by two reviewers, passed CI, and resolves #1982. | |
| #1655 lxd: distinguish argless clean from clean -s pull | snapcraft | merged | Merged fix for bug 1727445 distinguishing argless snapcraft clean from snapcraft clean -s pull in LXD. Approved by one reviewer, passed CI, and verified via manual testing. Changes span three files with a minimal diff. |