On Debian, I can have a package depend on locales-all to ensure that all locales are installed/available. There is no such package in Ubuntu.

It used to have belocs-locales-* which appeared to do the same; alternatively, one could depend on various localisation packs (e.g. just de+en+fr for most of Western Europe, which is of limited use; sometimes, software does in fact require all standard locales). These packages disappeared between hardy and precise, AFAICT.

So, what Ubuntu package can I Depends on to have all locales available?

Edit: this is not the same as the locales package, which merely provides data files needed to generate the locales; merely installing the locales-all package in Debian makes those locales available immediately, and all of them. (It contains a pack, in recent versions, saving much space too.) This way, the user does not have a knob in which they can (accidentally) disable necessary locales.

  • I don't think there is an equivalent in Ubuntu. One reason why locales-all is not included in the Ubuntu archive might be that it would conflict with the way Ubuntu's langpack system deals with locale creation (but that's just a guess). Out of curiosity: What kind of program would need instant access to all supported locales? – Gunnar Hjalmarsson Mar 18 '14 at 18:48
  • @GunnarHjalmarsson several kinds of webapps: I know one that uses system locales for server-side i18n, and I know one that has unexplainable failures that just go away when installing locales-all. My current "trigger to ask" is a package containing stuff that depends on one specific locale, but using locales is out of the question because other packages or the local admin can disable the locale later, if I enable it using e.g. debconf settings. – mirabilos Mar 18 '14 at 21:59
  • There’s now an open bug about this. – mirabilos Nov 21 '14 at 10:43
  • Noticed. I added a task for langpack-locales, which I think is the proper Ubuntu package. – Gunnar Hjalmarsson Nov 21 '14 at 14:59

I found the following solution on https://docs.moodle.org/dev/Table_of_locales

   sudo ln -s /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/all
   sudo locale-gen
  • 1
    Possibly, yes. But I cannot do this in a package. (See above: without the user being able to disable this again (except by uninstalling my package or locales-all).) Maybe needs ln -sf, too… – mirabilos Nov 10 '14 at 13:41

Unless I'm reading your wrong, this is just locales now.

It's part of the minimal^ task requirements as well as by ubuntu-minimal directly so this should always be installed. You shouldn't need to depend on anything to guarantee its presence but if you need something, pick ubuntu-minimal or something else you need that also depends on ubuntu-minimal. That's a pretty sane default.

Looking at the contents of Debian's locales-all I can see a lot of files like this that aren't in the standard Ubuntu locales package (see dpkg -L locales):


I searched packages.ubuntu.com for similar files and couldn't find any. This means they're either not packaged, they've got drastically different names, or they extract on install (rare but possible).

The only exception I can see are the locales installed by libc-bin into /usr/lib/locale/C.UTF-8/.

Ooo, I might have been on the money with the extraction. The locales package includes a locale-gen application which generates these sorts of files. See the wiki for more information on locales.

  • 2
    Just the locales package is not enough – true, with locale-gen I could generate specific locales, but this does not replace locales-all which makes all of them available without the need to run an extra command (and without the user being able to then manually disable those locales again). This is true in Debian as well. – mirabilos Mar 18 '14 at 16:35

I know that's an old question, but did you try install all language packs through apt-get? I could solve a similar problem where I would need lots of different locales in a server and solved it running sudo apt-get install language-pack-*. It downloaded all the files (about 2GB when finished unpacking) and generated all the available locales.

  • Thanks, but this is not a consistent solution, especially as I need to express it as package dependency, not as interactive thing, and a language pack is much more than just the locales. – mirabilos Jun 24 '15 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.