From 2d43385927fe4ee43a56b21a573b43fc67575ef2 Mon Sep 17 00:00:00 2001 From: ironjosh Date: Tue, 11 Sep 2018 18:15:19 +0800 Subject: [PATCH] [baseimage] set default locale en_US.UTF-8 (#1988) * [baseimage] set default locale en_US.UTF-8 Signed-off-by: chenhu * [baseimage]set default locale to en_US.UTF-8, clean all other unused * [baseimage] update-locale after locale-gen * correct update-locale command line Signed-off-by: Guohan Lu --- build_debian.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index e893b9df40..78f40cc20c 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -227,7 +227,14 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in hping3 \ python-scapy \ tcptraceroute \ - mtr-tiny + mtr-tiny \ + locales + +#Adds a locale to a debian system in non-interactive mode +sudo sed -i '/^#.* en_US.* /s/^#//' $FILESYSTEM_ROOT/etc/locale.gen && \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT locale-gen "en_US.UTF-8" +sudo LANG=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT update-locale "LANG=en_US.UTF-8" +sudo LANG=C chroot $FILESYSTEM_ROOT bash -c "find /usr/share/i18n/locales/ ! -name 'en_US' -type f -exec rm -f {} +" # Install certain fundamental packages from stretch-backports in order to get # more up-to-date (but potentially less stable) versions