Gentoo: Specifying only needed locales

Reading time: 2 – 3 minutes

[Gentoo Weekly News] The locales a user can choose from are built by the glibc. Usually all
available locales starting from aa_DJ (Afar locale for Djibouti) over
en_US (English locale for the USA) to zu_ZA.utf8 (Zulu locale for South
Africa) will be installed. Unless you’re working at the UN and administer
a central server for all member states, it is difficult to conceive why
you would need a system where all of these locales are installed. This
week’s tip was written with all those of you in mind who’d like to save 90
percent of the space occupied by locales in their system, by limiting the
number of installed locales to the bare minimum.

Ever since sys-libs/glibc-2.3.4.20040619-r2 has been in Portage, a
USE-flag called userlocales was provided to make sure only those locales
mentioned in /etc/locales.build are to be built and installed. As a
side-effect, this also leads to a much faster emerge of glibc, obviously.

Activate the userlocales USE flag especially for |
glibc

echo "sys-libs/glibc userlocales" >> /etc/portage/package.use

Now specify the locales you want to be able to use: (/etc/locales.build)

The format of the locales is described in the file itself.               
en_US/ISO-8859-1
en_US.UTF-8/UTF-8
de_DE/ISO-8859-1
de_DE@euro/ISO-8859-15
de_DE.UTF-8/UTF-8

For further information about locale-handling make sure you read our
Gentoo Linux Localization Guide.

Another interesting tool is app-admin/localepurge which can clean out any
installed man-page or info-file in languages you don’t need on your
system. You should read the man-page to localepurge in any case, and
configure languages you intend to keep in /etc/locale.nopurge.

By the way, if you want to prohibit the installation of all man-pages,
info-files or documentation, for example when space on your disk is
severely limited, you can add noman, nodoc and/or noinfo to FEATURES in
your /etc/make.conf.

Últimas entradas

Archivo
Scroll to Top