From ca100e093b9587f99dd221b610fa1bb2170f6f02 Mon Sep 17 00:00:00 2001 From: Murph Murphy Date: Mon, 27 Jul 2026 10:57:40 -0600 Subject: [PATCH] Fix for jammy previous image w/ different sources format --- .forgejo/workflows/build-debian.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build-debian.yml b/.forgejo/workflows/build-debian.yml index 637f9e3c5..a0eede213 100644 --- a/.forgejo/workflows/build-debian.yml +++ b/.forgejo/workflows/build-debian.yml @@ -81,7 +81,14 @@ jobs: # so apt update 404s. Restrict the main sources to amd64 and # fetch arm64 from ports.ubuntu.com instead. CODENAME=$(lsb_release -sc) - sed -i '/^Components:/a Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources + # deb822 sources (noble and newer) + if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then + sed -i '/^Components:/a Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources + fi + # one-line sources (jammy and older) + if [ -f /etc/apt/sources.list ]; then + sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list + fi printf 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports %s main restricted universe multiverse\n' \ "$CODENAME" "$CODENAME-updates" "$CODENAME-security" \ > /etc/apt/sources.list.d/arm64-ports.list