Skip to content

Set DPkg::Lock::Timeout on apt-get calls - #455

Open
colinbjohnson wants to merge 1 commit into
DataDog:mainfrom
colinbjohnson:apt-dpkg-lock-timeout
Open

colinbjohnson wants to merge 1 commit into
DataDog:mainfrom
colinbjohnson:apt-dpkg-lock-timeout

Conversation

@colinbjohnson

Copy link
Copy Markdown

What does this PR do?

Adds -o DPkg::Lock::Timeout="60" to the apt-get update / apt-get install calls on the install path.

Motivation

Fixes #449. apt-get fails immediately when another process holds the dpkg lock (cloud-init, unattended-upgrades on first boot). Acquire::Retries only retries downloads, not lock acquisition. DPkg::Lock::Timeout makes apt wait for the lock; apt versions that predate the option (< 1.9.11) ignore it, so the existing "Could not get lock" retry loop is left in place.

Additional Notes

Verified make output with bash -n.

apt-get fails immediately when another process holds the dpkg lock
(e.g. cloud-init or unattended-upgrades on first boot). Acquire::Retries
only retries downloads, not lock acquisition. DPkg::Lock::Timeout makes
apt wait for the lock; apt versions that predate the option ignore it.

Fixes DataDog#449
@colinbjohnson
colinbjohnson requested a review from a team as a code owner September 19, 2026 23:50
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.

apt-get calls don't set DPkg::Lock::Timeout, fail immediately on dpkg lock contention

1 participant