You've tried to apply a recipe for Ubuntu under Debian. That usually works, but in this specific case it doesn't.
Ubuntu is derived from Debian, and doesn't change much apart from the installer and the GUI. The locale-gen
command is one of those few other things that it changes. I don't know why.
Under Debian, the locale-gen
command takes no arguments and regenerates the compiled locale definitions according to the configured list of locales. To modify the selection of locales that you want to use, edit the file /etc/locale.gen
then run the locale-gen
command. Alternatively, run dpkg-reconfigure locales
as root, select the additional locales you want (and deselect the ones you don't want), and press OK.
Under Ubuntu, if you run the locale-gen
command without arguments, it regenerates the compiled locale definitions according to the configured list of locales. But if you pass some arguments, they're added to the list and generated immediately. The list of locales is kept in /var/lib/locales/supported.d/local
. Running dpkg-reconfigure locales
just regenerates the compiled locales without giving you an opportunity to modify the selection.
In summary, to add en_US.UTF-8
to the list of usable locales:
- Debian, interactive:
dpkg-reconfigure locales
- Debian, automated:
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen
- Ubuntu, automated:
locale-gen en_US.UTF-8