Skip to content

docs: wait for the dpkg lock before the scripted deb install - #4330

Open
ayushsingh82 wants to merge 1 commit into
malbeclabs:mainfrom
ayushsingh82:fix/3540-apt-lock-wait
Open

ayushsingh82 wants to merge 1 commit into
malbeclabs:mainfrom
ayushsingh82:fix/3540-apt-lock-wait

Conversation

@ayushsingh82

Copy link
Copy Markdown
Contributor

Problem

Closes #3540.

The scripted install path documented in client/INSTALL.md can hang indefinitely at RUN: Attempting to install 'apt-transport-https' ... on fresh Ubuntu LTS hosts. Restarting the script clears it up, so the impact is cosmetic — but the user sees zero feedback for several minutes and reasonably concludes the installer is broken.

Root cause: client/INSTALL.md directs users to pipe setup.deb.sh (a Cloudsmith template, not ours) to bash. That script runs apt-get install -y "$tool" &>$tmp_log, redirecting all output to a throwaway log. On a freshly-booted Ubuntu LTS host, unattended-upgrades.service holds /var/lib/dpkg/lock-frontend, so apt-get install blocks waiting for the lock. apt's default DPkg::Lock::Timeout=-1 means wait forever, and apt's normal Waiting for cache lock: held by process N (unattended-upgr)... message is swallowed by the redirect. It typically unblocks within ~20 min once the background upgrade finishes.

Fix

Of the three options in the issue (ship our own setup.deb.sh, customize/PR the Cloudsmith template, or a doc-only mitigation), this takes the cheapest one with real impact: a preflight one-liner in client/INSTALL.md before the curl | bash, waiting for the dpkg lock and printing why, so the wait is visible instead of silent. The durable fix (our own install script with a real timeout and non-swallowed output) is a separate, bigger change — happy to track that separately if wanted.

Testing Verification

Docs-only change; verified the added shell snippet's syntax and that it matches the exact one-liner proposed in the issue.

client/INSTALL.md directs users to pipe setup.deb.sh to bash. That
Cloudsmith template (not ours) runs apt-get install with all output
redirected to a throwaway log file. On a freshly-booted Ubuntu LTS
host, unattended-upgrades.service holds /var/lib/dpkg/lock-frontend,
so apt-get blocks waiting for the lock with DPkg::Lock::Timeout=-1
(wait forever) — and apt's own "Waiting for cache lock..." message is
swallowed by the redirect. The user sees nothing and assumes a hang;
it usually clears on its own within ~20 min once the background
upgrade finishes.

Added a preflight one-liner before the curl | bash that waits for the
lock and prints why, so the wait is visible instead of silent. Cheapest
of the three options in the issue (own setup.deb.sh / Cloudsmith
template customization / doc-only mitigation); the durable fix would
be shipping our own setup script, tracked separately if wanted.

Closes malbeclabs#3540.
@ayushsingh82
ayushsingh82 requested a review from a team September 13, 2026 18:35
@ayushsingh82

Copy link
Copy Markdown
Contributor Author

@ben-dz could you take a look when you have a chance?

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.

client/install: scripted install hangs silently on fresh Ubuntu LTS hosts

1 participant