From 61478bb90baaee06ae231c0626fb9e0f6361371b Mon Sep 17 00:00:00 2001 From: jackybabes <58730566+jackybabes@users.noreply.github.com> Date: Sat, 21 Nov 2026 12:59:56 +0000 Subject: [PATCH 1/2] fix(install): don't run get.docker.com on unsupported distros get.docker.com only handles a fixed set of distros. On Kali it adds a Docker repo for "debian kali-rolling", which doesn't exist, so apt update fails and keeps failing after the installer exits. ensure_docker now uses get.docker.com only for the distros it supports. Other apt-based distros install docker.io and a compose v2 package from their own repos, and the docker service is started explicitly because Kali doesn't start services on install. A broken docker.list left by an earlier run is removed. Co-Authored-By: Claude Opus 5.5 --- install.sh | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8c245d6..50f49fe 100755 --- a/install.sh +++ b/install.sh @@ -29,8 +29,10 @@ ensure_docker(){ case "$(uname -s)" in Linux) if [ "$(ask 'Install Docker automatically? (y/n)' y)" = y ]; then - curl -fsSL https://get.docker.com | sh + install_docker_linux sudo usermod -aG docker "$USER" || true + docker compose version >/dev/null 2>&1 || sudo docker compose version >/dev/null 2>&1 \ + || die "docker installed but 'docker compose' is unavailable; install the compose v2 plugin and retry" ok "Docker installed (re-login required for the group change to take effect)" else die "please install docker yourself and retry" @@ -40,6 +42,47 @@ ensure_docker(){ esac } +# install_docker_linux uses get.docker.com only on the distros it supports. That +# script keys its repo URL off /etc/os-release ID + codename, so on derivatives +# such as Kali it writes a repo for a nonexistent release (debian kali-rolling) +# and leaves apt broken. Other apt-based distros get the distro's own packages. +install_docker_linux(){ + local id="" id_like="" + if [ -r /etc/os-release ]; then + id="$(. /etc/os-release && echo "${ID:-}")" + id_like="$(. /etc/os-release && echo "${ID_LIKE:-}")" + fi + case "$id" in + ubuntu|debian|raspbian|centos|fedora|rhel|sles) + curl -fsSL https://get.docker.com | sh + return ;; + esac + command -v apt-get >/dev/null 2>&1 \ + || 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). + 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 + warn "removing broken Docker repo $f" + sudo rm -f "$f" + fi + done + sudo apt-get update + sudo apt-get install -y docker.io + # The compose v2 package name varies across Debian derivatives; take the first that exists. + local p + for p in docker-compose-plugin docker-compose-v2 docker-compose; do + if apt-cache madison "$p" 2>/dev/null | grep -q .; then + sudo apt-get install -y "$p" && break + fi + done + # Kali (and some others) don't start services on package install. + if command -v systemctl >/dev/null 2>&1; then + sudo systemctl enable --now docker || true + fi +} + # ── 1) All-Docker ─────────────────────────────── install_docker(){ ensure_docker 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 2/2] 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