From 66072331d9239eebce665869f2e8a6b75f642f2e Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 4 May 2026 12:52:42 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20apt=20sources.list=20for?= =?UTF-8?q?=20multi-arch=20Ubuntu=2018.04=20support=20=F0=9F=94=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace sed-based old-releases redirect with architecture-aware mirror selection - Use official archive.ubuntu.com for amd64/i386 and ports.ubuntu.com for other architectures - Rewrite sources.list directly with explicit bionic, bionic-updates, bionic-backports, and bionic-security entries - Ensures correct package sources are used without relying on old-releases fallback Dockerfile.18.04 --- Dockerfile.18.04 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile.18.04 b/Dockerfile.18.04 index 19c810d..c78666a 100644 --- a/Dockerfile.18.04 +++ b/Dockerfile.18.04 @@ -83,8 +83,13 @@ RUN set -e; \ echo "Setting up prerequisites"; \ echo "$LANG UTF-8" >"/etc/locale.gen"; \ echo 'export DEBIAN_FRONTEND="'${DEBIAN_FRONTEND}'"' >"/etc/profile.d/apt.sh" && chmod 755 "/etc/profile.d/apt.sh"; \ - sed -i 's|http://archive.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list || true; \ - sed -i 's|http://security.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list || true; \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in amd64|i386) ubuntu_mirror="http://archive.ubuntu.com/ubuntu"; ubuntu_security="http://security.ubuntu.com/ubuntu" ;; *) ubuntu_mirror="http://ports.ubuntu.com/ubuntu-ports"; ubuntu_security="$ubuntu_mirror" ;; esac; \ + printf '%s\n' \ + "deb ${ubuntu_mirror} bionic main restricted universe multiverse" \ + "deb ${ubuntu_mirror} bionic-updates main restricted universe multiverse" \ + "deb ${ubuntu_mirror} bionic-backports main restricted universe multiverse" \ + "deb ${ubuntu_security} bionic-security main restricted universe multiverse" > /etc/apt/sources.list; \ apt-get update && apt-get upgrade -yy && apt-get install -yy bash locales apt-utils; \ update-alternatives --install /bin/sh sh /bin/bash 1; \ update-alternatives --install /usr/bin/sh sh /bin/bash 1; \