From 5d4f70e94377fc82c145d6977e20effc5d6b16d7 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sat, 25 Oct 2025 17:22:52 +0200 Subject: [PATCH] Update auto_post_install.sh --- scripts/post_install/auto_post_install.sh | 30 ++++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/scripts/post_install/auto_post_install.sh b/scripts/post_install/auto_post_install.sh index c81d584..fa7e7d3 100644 --- a/scripts/post_install/auto_post_install.sh +++ b/scripts/post_install/auto_post_install.sh @@ -205,30 +205,14 @@ configure_time_sync() { # ========================================================== + skip_apt_languages() { - msg_info "$(translate "Configuring APT to skip downloading additional languages...")" - local default_locale="" - - if [ -f /etc/default/locale ]; then - default_locale=$(grep '^LANG=' /etc/default/locale | cut -d= -f2 | tr -d '"') - elif [ -f /etc/environment ]; then - default_locale=$(grep '^LANG=' /etc/environment | cut -d= -f2 | tr -d '"') - fi - - default_locale="${default_locale:-en_US.UTF-8}" - local normalized_locale=$(echo "$default_locale" | tr 'A-Z' 'a-z' | sed 's/utf-8/utf8/;s/-/_/') - - if ! locale -a | grep -qi "^$normalized_locale$"; then - if ! grep -qE "^${default_locale}[[:space:]]+UTF-8" /etc/locale.gen; then - echo "$default_locale UTF-8" >> /etc/locale.gen - fi - locale-gen "$default_locale" > /dev/null 2>&1 - fi - - echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/99-disable-translations - - msg_ok "$(translate "APT configured to skip additional languages")" - register_tool "apt_languages" true + msg_info "$(translate "Configuring APT to skip downloading additional languages...")" + cat > /etc/apt/apt.conf.d/99-disable-translations <<'EOF' +Acquire::Languages "none"; +EOF + msg_ok "$(translate "APT configured to skip additional languages")" + register_tool "apt_languages" true } # ==========================================================