Setting the default locale in Ubuntu
This is merely a reminder for me, as I always have to look it up, when I need it.
Debian (and Ubuntu prior 10.04) had a nice way of selecting and generating system locales. I don’t know exactly why Ubuntu removed that in its latter versions, but „dpkg-reconfigure locales“ doesn’t allow you to select the locale anymore. Of course, selecting the locale via „dpkg-reconfigure locales“ would only add a valid entry into one of the configuration files, but it was nice.
However, there is an easy way of doing this. And as I couldn’t find a nice overview of it somewhere on the internet, here’s mine:
So, to globally set the default locale for a system (let’s take de_DE.UTF-8 as an example) do the following:
* Generate it by issuing
locale-gen de_DE.UTF-8
* Set it using
update-locale LANG=de_DE.UTF-8
* Finally, clean up the system with the command
locale-gen –purge –no-archive
And you’re done.