diff --git a/home/.chezmoihooks/ensure-pre-requisites.sh b/home/.chezmoihooks/ensure-pre-requisites.sh index 9217fad..493458c 100755 --- a/home/.chezmoihooks/ensure-pre-requisites.sh +++ b/home/.chezmoihooks/ensure-pre-requisites.sh @@ -29,4 +29,4 @@ source "${CHEZMOI_SOURCE_DIR?}/.chezmoitemplates/scripts-library" log_task "Installing missing packages with APT: ${missing_packages[*]}" c sudo apt update -c sudo apt install --yes --no-install-recommends "${missing_packages[@]}" +c sudo DEBIAN_FRONTEND=noninteractive apt install --yes --no-install-recommends "${missing_packages[@]}" diff --git a/home/.chezmoiscripts/run_onchange_before_20-upgrade-ca-certificates.sh.tmpl b/home/.chezmoiscripts/run_onchange_before_20-upgrade-ca-certificates.sh.tmpl index e40ebfd..aa694ba 100644 --- a/home/.chezmoiscripts/run_onchange_before_20-upgrade-ca-certificates.sh.tmpl +++ b/home/.chezmoiscripts/run_onchange_before_20-upgrade-ca-certificates.sh.tmpl @@ -10,13 +10,15 @@ true || source ../.chezmoitemplates/scripts-library log_task "Upgrading ca-certificates" -# Ignore apt update error if it is due to expired certificate (because chances are that -# the next command will fix it. -if output="$(c sudo apt update --yes)" || [[ "${output}" == *"The certificate chain uses expired certificate."* ]]; then +# Ignore apt update error if it is due to expired certificate (because chances +# are that the next command will fix it). +# shellcheck disable=SC2310 +if output="$(c sudo apt update)" || [[ "${output}" == *"The certificate chain uses expired certificate."* ]]; then echo "${output}" true else echo "${output}" exit 1 fi -c sudo apt install --yes --no-install-recommends ca-certificates + +c sudo DEBIAN_FRONTEND=noninteractive apt install --yes --no-install-recommends ca-certificates diff --git a/home/dot_local/bin/executable_full-upgrade.tmpl b/home/dot_local/bin/executable_full-upgrade.tmpl index 8a0b91e..66caf3b 100644 --- a/home/dot_local/bin/executable_full-upgrade.tmpl +++ b/home/dot_local/bin/executable_full-upgrade.tmpl @@ -114,8 +114,8 @@ fi if apt --version &>/dev/null; then log_task "Updating apt packages" - c sudo DEBIAN_FRONTEND=noninteractive apt update --yes - c sudo DEBIAN_FRONTEND=noninteractive apt upgrade --yes + c sudo apt update + c sudo DEBIAN_FRONTEND=noninteractive apt full-upgrade --yes c sudo DEBIAN_FRONTEND=noninteractive apt autoremove --yes fi diff --git a/root/.chezmoihooks/ensure-pre-requisites.sh b/root/.chezmoihooks/ensure-pre-requisites.sh index e5caff6..1f23509 100755 --- a/root/.chezmoihooks/ensure-pre-requisites.sh +++ b/root/.chezmoihooks/ensure-pre-requisites.sh @@ -24,7 +24,7 @@ fi # shellcheck source=../.chezmoitemplates/scripts-library source "${CHEZMOI_SOURCE_DIR?}/.chezmoitemplates/scripts-library" -log_task "Installing missing packages with APT: ${missing_packages[*]}" +log_task "Installing missing pre-requisite packages with APT: ${missing_packages[*]}" c apt update -c apt install --yes --no-install-recommends "${missing_packages[@]}" +c DEBIAN_FRONTEND=noninteractive apt install --yes --no-install-recommends "${missing_packages[@]}" diff --git a/root/.chezmoiscripts/run_after_10-install-apt-packages.sh.tmpl b/root/.chezmoiscripts/run_after_10-install-apt-packages.sh.tmpl index c5d0459..a99ddc2 100644 --- a/root/.chezmoiscripts/run_after_10-install-apt-packages.sh.tmpl +++ b/root/.chezmoiscripts/run_after_10-install-apt-packages.sh.tmpl @@ -69,14 +69,15 @@ done if [[ ${#missing_packages[@]} -gt 0 ]]; then log_task "Installing missing packages with APT: ${missing_packages[*]}" - c apt update --yes + c apt update + extra_args=() if [[ "${DOTFILES_TEST:-}" == true ]]; then log_manual_action "Not installing recommended packages to speed up test mode" - recommends_arg="--no-install-recommends" + extra_args+=("--no-install-recommends") else - recommends_arg="--install-recommends" + extra_args+=("--install-recommends") fi - c apt install --yes "${recommends_arg}" "${missing_packages[@]}" + c DEBIAN_FRONTEND=noninteractive apt install --yes "${extra_args[@]}" "${missing_packages[@]}" fi diff --git a/root/.chezmoiscripts/run_before_30-uninstall-apt-packages.sh.tmpl b/root/.chezmoiscripts/run_before_30-uninstall-apt-packages.sh.tmpl index a587286..8f28b71 100644 --- a/root/.chezmoiscripts/run_before_30-uninstall-apt-packages.sh.tmpl +++ b/root/.chezmoiscripts/run_before_30-uninstall-apt-packages.sh.tmpl @@ -22,6 +22,6 @@ for package in "${unwanted_packages[@]}"; do # shellcheck disable=SC2310 if is_apt_package_installed "${package}"; then log_task "Removing unwanted package '${package}' installed with APT" - c apt remove --yes --auto-remove "${package}" + c DEBIAN_FRONTEND=noninteractive apt remove --yes --auto-remove "${package}" fi done diff --git a/scripts/install_dotfiles.sh b/scripts/install_dotfiles.sh index 0dc4355..9ced52b 100755 --- a/scripts/install_dotfiles.sh +++ b/scripts/install_dotfiles.sh @@ -76,9 +76,9 @@ DOTFILES_BRANCH=${DOTFILES_BRANCH:-"master"} DOTFILES_DIR="${HOME}/.dotfiles" if ! command -v git >/dev/null 2>&1; then - log_task "Installing git" - sudo apt update --yes - sudo apt install --yes --no-install-recommends git + log_task "Installing git with APT" + sudo apt update + sudo DEBIAN_FRONTEND=noninteractive apt install --yes --no-install-recommends git fi if [ -d "${DOTFILES_DIR}" ]; then diff --git a/scripts/test.sh b/scripts/test.sh index 17a575d..1ed5ad8 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -179,7 +179,7 @@ for variant in "${variants[@]}"; do export IS_WSL=true # Exercises install-pre-requisites.sh -sudo apt remove --yes zsh curl git gpg +sudo DEBIAN_FRONTEND=noninteractive apt remove --yes --auto-remove zsh curl git gpg cat <<'EOM' | sudo tee /usr/local/bin/wslpath #!/bin/bash @@ -205,8 +205,8 @@ EOF run_test "${os}" "$( # shellcheck disable=SC2312 cat <<'EOF' -sudo apt update --yes -sudo apt install --yes --no-install-recommends gnome-shell +sudo apt update +sudo DEBIAN_FRONTEND=noninteractive apt install --yes --no-install-recommends gnome-shell EOF )" ;;