From bb07a3800680b67d23bfd7acb713c36251877276 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Mon, 26 Feb 2024 20:23:16 +0100 Subject: [PATCH] Up. --- .../run_onchange_10-install-packages.sh.tmpl | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/home/.chezmoiscripts/run_onchange_10-install-packages.sh.tmpl b/home/.chezmoiscripts/run_onchange_10-install-packages.sh.tmpl index 0a3ba1b..0957503 100644 --- a/home/.chezmoiscripts/run_onchange_10-install-packages.sh.tmpl +++ b/home/.chezmoiscripts/run_onchange_10-install-packages.sh.tmpl @@ -62,6 +62,26 @@ packages=( {{- /* we're on Debian based system */ -}} echo -e "\033[0;32m>>>>> Begin Debian/Ubuntu Linux packages installation <<<<<\033[0m" + ## Update system + {{- if ne .chezmoi.username "root" }} + DEBIAN_FRONTEND=noninteractive sudo -E apt update + DEBIAN_FRONTEND=noninteractive sudo -E apt upgrade --yes + {{- else }} + DEBIAN_FRONTEND=noninteractive apt update + DEBIAN_FRONTEND=noninteractive apt upgrade --yes + {{- end}} + + ## Install packages + for package in ${packages[@]}; do + echo "installing packages" + + {{- if ne .chezmoi.username "root" }} + DEBIAN_FRONTEND=noninteractive sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package + {{- else }} + DEBIAN_FRONTEND=noninteractive sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package + {{- end }} + done + echo -e "\033[0;32m>>>>> Finish Debian/Ubuntu Linux packages installation <<<<<\033[0m" {{- end }}