From c90e2c980cd0f533a36f843b0b022ed948bace76 Mon Sep 17 00:00:00 2001 From: jackybabes <58730566+jackybabes@users.noreply.github.com> Date: Sat, 21 Nov 2026 15:53:05 +0000 Subject: [PATCH] fix(install): match deb822 docker.sources across lines In a deb822 .sources file the URIs and Suites fields are on separate lines, so the single-line grep never matched and the broken Docker repo was left in place. Match the URI and the distro id separately across the whole file, and skip the check when the id is empty. Co-Authored-By: Claude Opus 5.5 --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 50f49fe..ce73292 100755 --- a/install.sh +++ b/install.sh @@ -61,9 +61,14 @@ install_docker_linux(){ || die "automatic Docker install is not supported on '${id:-unknown}'; please install docker + the compose plugin yourself and retry" info "'${id:-unknown}' (like: ${id_like:-n/a}) is not supported by get.docker.com; installing from the distro's apt repos" # Drop a broken repo left by an earlier get.docker.com run (it fails every apt update). + # Match the URI and the distro id anywhere in the file: in a one-line .list entry + # they share a line, but in a deb822 .sources file the URIs and Suites fields are + # on separate lines. -w keeps "kali" matching inside "kali-rolling". local f for f in /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/docker.sources; do - if [ -f "$f" ] && grep -q "download.docker.com/linux/debian.*${id}" "$f" 2>/dev/null; then + if [ -n "$id" ] && [ -f "$f" ] \ + && grep -qF "download.docker.com/linux/debian" "$f" 2>/dev/null \ + && grep -qwF "$id" "$f" 2>/dev/null; then warn "removing broken Docker repo $f" sudo rm -f "$f" fi