- Code: Select all
# comment them all in locale.gen
sed -i '/^[a-z][a-z]_/s/^/# /' /CENSORED/locale.gen
# find the current active locale and uncomment it
CURRENT_LOCALE=$(cat /CENSORED/default/locale | grep -o "[a-z].*")
sed -i "0,/# $CURRENT_LOCALE/s/# $CURRENT_LOCALE/$CURRENT_LOCALE/" /CENSORED/locale.gen
Voila! The current active one only is now checked when dpkg-reconfigure locales is run. Works also in installer preinst script.
BTW a sid image rebuilt with the line for "user" removed from sudoers has sudo working with "components=sudo" (config=sudo in old live-config) on cmdline.