# locales i Gentoo

## Xywa

Witam,

Podczas update systemu, kompilacja wywaliła się podczas ca-certificates, któremu nie pasują moje locales (ponoć najlepiej mieć UTF-8, bo w tej chwili mam POSIX). Jak najlepiej zmienić locales na inne pod Gentoo, robiłem to dawno temu i zapomniałem. Używam języka angielskiego.

```
>>> Emerging (2 of 4) app-misc/ca-certificates-20111025
```

```
>>> Failed to install app-misc/ca-certificates-20111025, Log file:
```

```
 * For best results, UTF-8 encoding is recommended. See the Gentoo Linux

 * Localization Guide for instructions about how to configure your locale

 * for UTF-8 encoding:

```

```
 * This package installs one or more file names containing characters that

 * do not match your current locale settings. The current setting for

 * filesystem encoding is 'ANSI_X3.4-1968'.

```

```
# emerge --info

Portage 2.1.10.11 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.3, glibc-2.13-r4, 3.0.6-gentoo x86_64)

=================================================================

System uname: Linux-3.0.6-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T5800_@_2.00GHz-with-gentoo-2.0.3

Timestamp of tree: Tue, 13 Dec 2011 10:30:01 +0000

app-shells/bash:          4.1_p9

dev-java/java-config:     2.1.11-r3

dev-lang/python:          2.7.2-r3, 3.1.4-r3

dev-util/cmake:           2.8.4-r1

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.0.3

sys-apps/openrc:          0.9.4

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13, 2.68

sys-devel/automake:       1.10.3, 1.11.1

sys-devel/binutils:       2.21.1-r1

sys-devel/gcc:            4.5.3-r1

sys-devel/gcc-config:     1.4.1-r1

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82-r1

sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)

sys-libs/glibc:           2.13-r4

Repositories: gentoo

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="* -@EULA"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=native -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /var/lib/hsqldb"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-march=native -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans"

FFLAGS=""

GENTOO_MIRRORS="http://212.219.56.138/sites/www.ibiblio.org/gentoo/ http://mirror.bytemark.co.uk/gentoo/"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="pl en en_GB"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X a52 aac aalib acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups curl cxx dbus declarative dri dts dv dvd dvdr embedded emboss encode exif extras fam ffmpeg firefox flac fortran frei0r gdbm gdu gif gimp glib gnutls gphoto2 gpm gstreamer gtk iconv icu ios ipod ipv6 java jpeg kde kipi laptop lcms ldap libnotify libsamplerate mad melt mmx mng modules mono mp3 mp4 mpeg mpi mudflap multilib mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pppd qt3support qt4 quicktime readline reports romio scale0tilt scanner sdl sdlgfx semantic-desktop session smp spell sql sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd threads tiff truetype udev unicode usb vaapi vdpau vorbis webkit x264 xcb xcomposite xine xinerama xml xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en en_GB" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

```
# locale

LANG=

LC_CTYPE="POSIX"

LC_NUMERIC="POSIX"

LC_TIME="POSIX"

LC_COLLATE="POSIX"

LC_MONETARY="POSIX"

LC_MESSAGES="POSIX"

LC_PAPER="POSIX"

LC_NAME="POSIX"

LC_ADDRESS="POSIX"

LC_TELEPHONE="POSIX"

LC_MEASUREMENT="POSIX"

LC_IDENTIFICATION="POSIX"

LC_ALL=
```

----------

## Pryka

eee

```
* For best results, UTF-8 encoding is recommended. See the Gentoo Linux

 * Localization Guide for instructions about how to configure your locale

 * for UTF-8 encoding:
```

http://www.gentoo.org/doc/en/guide-localization.xml

http://www.gentoo.org/doc/pl/guide-localization.xml

----------

## Xywa

 *Pryka wrote:*   

> eee
> 
> ```
> * For best results, UTF-8 encoding is recommended. See the Gentoo Linux
> 
> ...

 

Czytałem to przed zamieszczeniem tego posta, więc sprecyzuje - którą zmienną w moim przypadku nadpisać? Bo z infa wynika żeby nie ruszać  LC_ALL.

 *Quote:*   

> LANG	 Definiuje wszystkie ustawienia w lokalizacji naraz. Dalsze indywidualne dopasowanie ustawień odbywa się za pomocą zmiennych LC_* opisanych poniżej. 
> 
> LC_COLLATE	 Definiuje porządek alfabetyczny. Może mieć efekt na np. wyświetlenie zawartości katalogów. 
> 
> LC_CTYPE	 Definiuje zarządzanie ustawieniami znaków dla systemu. Np. które znaki są widziane jako część alfabetu, a które jako numeryczne. Czasami ustawia to również zestaw używanych znaków. 
> ...

 

Druga kwestia, jeżeli w systemie nie mam /etc/env.d/02locale, czy mam go ręcznie utworzyć?

```
# ls -la /etc/env.d/

total 148

drwxr-xr-x  6 root root 4096 Dec  8 21:26 .

drwxr-xr-x 80 root root 4096 Dec 15 08:22 ..

-rw-r--r--  1 root root  221 Jun 18 05:00 00basic

-rw-r--r--  1 root root   37 Dec  5 09:33 00glibc

-rw-r--r--  1 root root  170 Dec  1 07:51 03opengl

-rw-r--r--  1 root root  108 Jul 25 08:03 04multilib

-rw-r--r--  1 root root  130 Aug 23 09:31 05binutils

-rw-r--r--  1 root root  321 Nov 15 08:24 05gcc-x86_64-pc-linux-gnu

-rw-r--r--  1 root root   35 Sep 18 10:37 08xulrunner

-rw-r--r--  1 root root   37 Nov 11 08:39 09sandbox

-rw-r--r--  1 root root   26 Nov 19 09:42 20ant

-rw-r--r--  1 root root   79 Jan 14  2009 20java-config

-rw-r--r--  1 root root   31 Nov 19 09:56 22javacc

-rw-r--r--  1 root root   46 Jul 24 19:31 30gnupg

-rw-r--r--  1 root root   56 Sep 27 07:50 30sane

-rw-r--r--  1 root root   81 Oct 20 09:27 30xdg-data-local

-rw-r--r--  1 root root   33 Nov 19 09:59 35hsqldb

-rw-r--r--  1 root root   44 Jul 24 14:08 37fontconfig

-rw-r--r--  1 root root   55 Dec  8 20:54 43kdepaths

-rw-r--r--  1 root root   25 Jul 24 18:07 44qca2

-rw-r--r--  1 root root   52 Sep 14 11:12 44qt4

-rw-r--r--  1 root root   22 Oct 17 09:37 44qt4-emul

-rw-r--r--  1 root root   59 Oct 16 10:24 50gconf

-rw-r--r--  1 root root   14 Oct 16 10:22 50gtk2

-rw-r--r--  1 root root   36 Dec  3 07:29 50ncurses

-rw-r--r--  1 root root   47 Nov 11 08:39 70less

-rw-r--r--  1 root root   70 Dec  8 21:26 77kde

-rw-r--r--  1 root root   94 Oct 29 08:41 90nss

-rw-r--r--  1 root root   54 Oct 20 09:27 90xdg-data-base

-rw-r--r--  1 root root   17 Jul 25 10:28 90xsession

-rw-r--r--  1 root root   48 Sep  2 08:16 98ca-certificates

-rw-r--r--  1 root root   42 Jan  6  2011 99gentoolkit-env

-rw-r--r--  1 root root   54 Jul 25 21:42 99oxygen-gtk

drwxr-xr-x  2 root root 4096 Nov 30 12:33 binutils

drwxr-xr-x  3 root root 4096 Jul 26 10:28 blas

drwxr-xr-x  2 root root 4096 Nov 15 08:24 gcc

drwxr-xr-x  2 root root 4096 Jul 21 08:06 python

```

----------

## Pryka

Ja go tworzyłem o ile mnie pamięć nie zawodzi, wygląda to w moim przypadku tak:

```

LANG="pl_PL.UTF-8"

LC_COLLATE="C"
```

```
LANG=pl_PL.UTF-8

LC_CTYPE="pl_PL.UTF-8"

LC_NUMERIC="pl_PL.UTF-8"

LC_TIME="pl_PL.UTF-8"

LC_COLLATE=C

LC_MONETARY="pl_PL.UTF-8"

LC_MESSAGES="pl_PL.UTF-8"

LC_PAPER="pl_PL.UTF-8"

LC_NAME="pl_PL.UTF-8"

LC_ADDRESS="pl_PL.UTF-8"

LC_TELEPHONE="pl_PL.UTF-8"

LC_MEASUREMENT="pl_PL.UTF-8"

LC_IDENTIFICATION="pl_PL.UTF-8"

LC_ALL=
```

----------

## Jacekalex

```
cat /etc/env.d/02locale

LANG="pl_PL.UTF-8"

LC_CTYPE="pl_PL.UTF-8"

```

```
env-update; source /etc/profile
```

```
root  # locale

LANG=pl_PL.UTF-8

LC_CTYPE=pl_PL.UTF-8

LC_NUMERIC="pl_PL.UTF-8"

LC_TIME="pl_PL.UTF-8"

LC_COLLATE="pl_PL.UTF-8"

LC_MONETARY="pl_PL.UTF-8"

LC_MESSAGES="pl_PL.UTF-8"

LC_PAPER="pl_PL.UTF-8"

LC_NAME="pl_PL.UTF-8"

LC_ADDRESS="pl_PL.UTF-8"

LC_TELEPHONE="pl_PL.UTF-8"

LC_MEASUREMENT="pl_PL.UTF-8"

LC_IDENTIFICATION="pl_PL.UTF-8"

LC_ALL=
```

Zgodnie z handbookiem, i chodzi.

Problemów z lokalizacją nie stwierdzono.      :Smile: 

Pozdro

 :Cool: 

----------

