Linux Commands Examples

A great documentation place for Linux commands


compile a list of locale definition files

see also : localedef - locale


locale-gen [options] [locale] [language] ...

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales
echo "export LC_CTYPE=en_US.UTF-8" >> ~/.bash_profile
source ~/.bash_profile


Compiled locale files take about 50MB of disk space, and most users only need few locales. In order to save disk space, compiled locale files are not distributed in the locales package, but selected locales are automatically generated when this package is installed by running the locale-gen program.

If a list of languages and/or locales is specified as arguments, then locale-gen only generates these particular locales and adds the new ones to /var/lib/locales/supported.d/local. Otherwise it generates all supported locales.

Locale data files can be stored either in a single archive file, /usr/lib/locale/locale-archive, or in a deep tree where individual files are stored under /usr/lib/locale/<locale_name>/LC_*. But unlike the locales package, compiled locale definitions are not removed when running locale-gen, and locales are compiled again only if locale source files have changed.


These options override settings found in /etc/belocs/locale-gen.conf.


Display an help message and exit.


Remove all existing locales before processing.


Do not remove existing locales before processing.


When this option is set, locale data are stored in a single archive /usr/lib/locale/locale-archive.


When this option is set, locale data are stored in /usr/lib/locale/<locale_name>/LC_* files. This is the default.


Locale aliases are read from FILE.



List all locales to generate. File format is similar to /usr/share/i18n/SUPPORTED.


Customize how compiled locale files are stored onto disk.


Compiled locale data.


Generated archive containing compiled locale data, if --archive flag is set.


Directory used to keep track of changes in locale source files.

see also

locale def"> localedef , locale, locale-gen.conf.


The locale-gen program was originally written by Debian GNU libc maintainers, and has been improved by Denis Barbier <barbier[:at:]debian[:dot:]org> for the belocs-locales-bin package. This manual page has been rewritten from scratch to document the current behavior.

How can this site be more helpful to YOU ?

give  feedback