From caedf6a8e76ff36ae32e985c9d21317c33d8b6db Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 29 Apr 2024 13:11:27 +0200 Subject: [PATCH] remove resolvconf and enable systemd-resolved --- scripts/installer.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/installer.sh b/scripts/installer.sh index d7341b27d..dc80848b9 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -15,6 +15,8 @@ function log() { echo -e "$(date +'%Y-%m-%dT%H:%M:%S')" "==> installer: $1" } +export DEBIAN_FRONTEND=noninteractive + apt_ready="no" function prepare_apt_once() { [[ "${apt_ready}" == "yes" ]] && return @@ -76,10 +78,17 @@ if [[ "${ubuntu_version}" == "18.04" ]]; then exit 2 fi -# switch over to systemd -systemctl disable unbound || true -systemctl stop unbound || true -systemctl enable --now systemd-resolved +# switch over to resolved and uninstall resolvconf +if dpkg -s resolvconf 2>/dev/null >/dev/null; then + log "disabling unbound" + systemctl disable unbound || true + systemctl stop unbound || true + log "enabling systemd-resolved" + systemctl enable --now systemd-resolved + log "removing resolvconf" + prepare_apt_once + apt -y --purge remove resolvconf # purge required for dpkg -s to return error code +fi # https://docs.docker.com/engine/installation/linux/ubuntulinux/ readonly docker_version="26.0.1"