From 9c6385f3fc52da8eb492ace2b4f4c4f52b0ea559 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 19 Nov 2026 18:20:56 +1100 Subject: [PATCH] Wait for the dpkg lock before installing the LaTeX packages Preventive: on a freshly launched RunsOn machine unattended-upgrades can still hold the dpkg lock, and apt-get install then fails at once. The race was seen twice in lecture-jax's preview on 2026-11-19, not yet here. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL --- .github/workflows/ci.yml | 4 +++- .github/workflows/publish.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e64f71a9..beadc8a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,8 +47,10 @@ jobs: python -c "import matplotlib.font_manager" - name: Install latex dependencies run: | + # A freshly launched machine can still be running unattended-upgrades, + # which holds the dpkg lock: wait for it (up to 10 minutes) instead of failing. sudo apt-get -qq update - sudo apt-get install -y \ + sudo apt-get -o DPkg::Lock::Timeout=600 install -y \ texlive-latex-recommended \ texlive-latex-extra \ texlive-fonts-recommended \ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 90f131f4..fa4676b0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -63,8 +63,10 @@ jobs: nvidia-smi - name: Install latex dependencies run: | + # A freshly launched machine can still be running unattended-upgrades, + # which holds the dpkg lock: wait for it (up to 10 minutes) instead of failing. sudo apt-get -qq update - sudo apt-get install -y \ + sudo apt-get -o DPkg::Lock::Timeout=600 install -y \ texlive-latex-recommended \ texlive-latex-extra \ texlive-fonts-recommended \