From 25782a3255004944932b9b470da49e5ef5b885dd Mon Sep 17 00:00:00 2001
From: Pietro Delsante
Date: Thu, 16 Jul 2026 14:31:40 +0200
Subject: [PATCH] CI: always refresh APT index before installing packages
The "Refresh APT repositories" step ran `apt-get update` only on an APT cache
miss. On a cache hit the index was left stale, so `apt-get install` failed with
404 Not Found when a pinned package version had been rotated out of the mirror
(e.g. libcurl4-openssl-dev). Run `apt-get update` unconditionally: it is cheap
and the APT cache still serves the .deb downloads.
Applied to workflows/_python.yml and its hard-linked .github/ self-test copy.
Co-Authored-By: Claude Opus 4.8 (1M context)
---
.github/workflows/_python.yml | 7 ++++---
workflows/_python.yml | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/_python.yml b/.github/workflows/_python.yml
index 4d0a4a5..58b6b64 100644
--- a/.github/workflows/_python.yml
+++ b/.github/workflows/_python.yml
@@ -287,10 +287,11 @@ jobs:
apt_requirements_file_path: ${{ inputs.packages_path }}
git_reference: ${{ github.base_ref }}
+ # Always refresh the APT index. Skipping this on an APT cache hit left a
+ # stale index, so `apt-get install` returned 404 when a pinned package
+ # version was rotated out of the mirror. The update is cheap; the cache
+ # still serves the .deb downloads.
- name: Refresh APT repositories
- if: >
- steps.restore_apt_cache_pr.outputs.cache-hit != 'true' &&
- steps.restore_apt_cache_target_branch.outputs.cache-hit != 'true'
run: |
sudo apt-get update
shell: bash
diff --git a/workflows/_python.yml b/workflows/_python.yml
index 4d0a4a5..58b6b64 100644
--- a/workflows/_python.yml
+++ b/workflows/_python.yml
@@ -287,10 +287,11 @@ jobs:
apt_requirements_file_path: ${{ inputs.packages_path }}
git_reference: ${{ github.base_ref }}
+ # Always refresh the APT index. Skipping this on an APT cache hit left a
+ # stale index, so `apt-get install` returned 404 when a pinned package
+ # version was rotated out of the mirror. The update is cheap; the cache
+ # still serves the .deb downloads.
- name: Refresh APT repositories
- if: >
- steps.restore_apt_cache_pr.outputs.cache-hit != 'true' &&
- steps.restore_apt_cache_target_branch.outputs.cache-hit != 'true'
run: |
sudo apt-get update
shell: bash