Skip to content

Commit 23d78cc

Browse files
committed
CI: Use apt config file to disable AppStream metadata downloads
Command-line flags (-o Acquire::IndexTargets::deb::DEP-11::DefaultEnabled) were not taking effect, causing continued dep11 download failures during mirror synchronization. Solution: Create /etc/apt/apt.conf.d/99-no-appstream configuration file before running apt update. This is more reliable than command-line options as apt always reads config files from /etc/apt/apt.conf.d/ directory.
1 parent f78ee79 commit 23d78cc

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ jobs:
6969

7070
- name: Install dependencies
7171
run: |
72-
# Retry apt-get update to handle transient mirror sync issues
73-
for i in 1 2 3; do
74-
sudo apt-get update -q=2 -o Acquire::Retries=3 && break || {
75-
echo "apt-get update attempt $i failed, retrying..."
76-
sleep 5
77-
}
78-
done
72+
# Create apt config to disable AppStream metadata (causes mirror sync failures)
73+
sudo mkdir -p /etc/apt/apt.conf.d
74+
echo 'Acquire::IndexTargets::deb::DEP-11 "false";' | sudo tee /etc/apt/apt.conf.d/99-no-appstream
75+
echo 'Acquire::IndexTargets::deb::DEP-11-icons "false";' | sudo tee -a /etc/apt/apt.conf.d/99-no-appstream
76+
echo 'Acquire::IndexTargets::deb::DEP-11-icons-hidpi "false";' | sudo tee -a /etc/apt/apt.conf.d/99-no-appstream
77+
sudo apt-get update -q=2 -o Acquire::Retries=3
7978
sudo apt-get install -q=2 -o Acquire::Retries=3 curl libsdl2-dev libsdl2-mixer-dev device-tree-compiler expect bc p7zip-full
8079
shell: bash
8180

@@ -307,13 +306,12 @@ jobs:
307306
githubToken: ${{ github.token }}
308307
# No 'sudo' is available
309308
install: |
310-
# Retry apt update to handle transient mirror sync issues
311-
for i in 1 2 3; do
312-
apt update -qq -o Acquire::Retries=3 && break || {
313-
echo "apt update attempt $i failed, retrying..."
314-
sleep 5
315-
}
316-
done
309+
# Create apt config to disable AppStream metadata (causes mirror sync failures)
310+
mkdir -p /etc/apt/apt.conf.d
311+
echo 'Acquire::IndexTargets::deb::DEP-11 "false";' > /etc/apt/apt.conf.d/99-no-appstream
312+
echo 'Acquire::IndexTargets::deb::DEP-11-icons "false";' >> /etc/apt/apt.conf.d/99-no-appstream
313+
echo 'Acquire::IndexTargets::deb::DEP-11-icons-hidpi "false";' >> /etc/apt/apt.conf.d/99-no-appstream
314+
apt update -qq -o Acquire::Retries=3 || true
317315
apt install -yqq -o Acquire::Retries=3 make git curl wget clang libsdl2-dev libsdl2-mixer-dev lsb-release software-properties-common gnupg bc
318316
which wget || echo "WARNING: wget not found after installation"
319317
# FIXME: gcc build fails on Aarch64/Linux hosts
@@ -323,9 +321,8 @@ jobs:
323321
run: |
324322
# Verify and install wget if needed (workaround for install step issues)
325323
if ! command -v wget > /dev/null 2>&1; then
326-
for i in 1 2 3; do
327-
apt update -qq -o Acquire::Retries=3 && break || sleep 5
328-
done
324+
# AppStream config should already exist from install step
325+
apt update -qq -o Acquire::Retries=3 || true
329326
apt install -yqq -o Acquire::Retries=3 wget
330327
fi
331328
git config --global --add safe.directory ${{ github.workspace }}
@@ -585,13 +582,12 @@ jobs:
585582
# LLVM static analysis
586583
- name: set up scan-build
587584
run: |
588-
# Retry apt-get update to handle transient mirror sync issues
589-
for i in 1 2 3; do
590-
sudo apt-get update -q=2 -o Acquire::Retries=3 && break || {
591-
echo "apt-get update attempt $i failed, retrying..."
592-
sleep 5
593-
}
594-
done
585+
# Create apt config to disable AppStream metadata (causes mirror sync failures)
586+
sudo mkdir -p /etc/apt/apt.conf.d
587+
echo 'Acquire::IndexTargets::deb::DEP-11 "false";' | sudo tee /etc/apt/apt.conf.d/99-no-appstream
588+
echo 'Acquire::IndexTargets::deb::DEP-11-icons "false";' | sudo tee -a /etc/apt/apt.conf.d/99-no-appstream
589+
echo 'Acquire::IndexTargets::deb::DEP-11-icons-hidpi "false";' | sudo tee -a /etc/apt/apt.conf.d/99-no-appstream
590+
sudo apt-get update -q=2 -o Acquire::Retries=3
595591
sudo apt-get install -q=2 -o Acquire::Retries=3 curl libsdl2-dev libsdl2-mixer-dev
596592
.ci/fetch.sh -q -o llvm.sh https://apt.llvm.org/llvm.sh
597593
chmod +x ./llvm.sh

0 commit comments

Comments
 (0)