mirror of
https://github.com/dockersrc/ubuntu
synced 2026-06-30 17:45:53 -04:00
🔧 Fix apt sources.list for multi-arch Ubuntu 18.04 support 🔧
- 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
This commit is contained in:
+7
-2
@@ -83,8 +83,13 @@ RUN set -e; \
|
|||||||
echo "Setting up prerequisites"; \
|
echo "Setting up prerequisites"; \
|
||||||
echo "$LANG UTF-8" >"/etc/locale.gen"; \
|
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"; \
|
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; \
|
arch="$(dpkg --print-architecture)"; \
|
||||||
sed -i 's|http://security.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list || true; \
|
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; \
|
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 /bin/sh sh /bin/bash 1; \
|
||||||
update-alternatives --install /usr/bin/sh sh /bin/bash 1; \
|
update-alternatives --install /usr/bin/sh sh /bin/bash 1; \
|
||||||
|
|||||||
Reference in New Issue
Block a user