Возникла проблема при добавлении 866 локали в контейнер из opensuse/tumbleweed:latest
В начальном состоянии - минимальный набор:
tumbleweed:~ # locale -a
C
C.utf8
POSIX
en_US.utf8
tumbleweed:~ # localedef --help
...
System's directory for character maps : /usr/share/i18n/charmaps
repertoire maps: /usr/share/i18n/repertoiremaps
locale path : /usr/lib/locale:/usr/share/i18n
tumbleweed:~ # ll /usr/lib/locale
total 8
drwxr-xr-x 3 root root 4096 Jan 22 02:27 C.utf8
drwxr-xr-x 3 root root 4096 Jan 22 02:27 en_US.utf8
tumbleweed:~ # ll /usr/share/i18n
ls: cannot access '/usr/share/i18n': No such file or directory
Про контейнер создатели говорят - мы все вырезали, если вам надо - добавьте glibc-locale.
zypper install -y glibc-locale
tumbleweed:~ # ll /usr/lib/locale | grep ru
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_RU
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_RU.koi8r
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_RU.utf8
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_UA
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_UA.utf8
tumbleweed:~ # cat /usr/lib/locale/ru_RU/LC_NAME
$345678%d%t%g%t%m%t%f ISO-8859-5
в glibc-locale нет 866, добавляю i18n, нахожу IBM866,
компилирую (если не считать всяких mr/mrs - выглядит успешно, тем более на полном TW - эти же варнинги)
zypper install -y glibc-i18ndata
tumbleweed:~ # ll /usr/share/i18n/charmaps | grep 866
-rw-r--r-- 1 root root 2682 Jan 20 16:33 IBM866.gz
-rw-r--r-- 1 root root 2864 Jan 20 16:33 IBM866NAV.gz
tumbleweed:~ # localedef -f IBM866 -i ru_RU ru_RU.CP866 -v
[warning] LC_NAME: field `name_gen' not defined
[warning] LC_NAME: field `name_mr' not defined
[warning] LC_NAME: field `name_mrs' not defined
[warning] LC_NAME: field `name_miss' not defined
[warning] LC_NAME: field `name_ms' not defined
[warning] LC_ADDRESS: field `country_post' not defined
[warning] LC_ADDRESS: field `country_isbn' not defined
[warning] LC_IDENTIFICATION: field `audience' not defined
[warning] LC_IDENTIFICATION: field `application' not defined
[warning] LC_IDENTIFICATION: field `abbreviation' not defined
[verbose] LC_CTYPE: table for class "upper": 0 bytes
[verbose] LC_CTYPE: table for class "lower": 0 bytes
[verbose] LC_CTYPE: table for class "alpha": 0 bytes
[verbose] LC_CTYPE: table for class "digit": 0 bytes
[verbose] LC_CTYPE: table for class "xdigit": 0 bytes
[verbose] LC_CTYPE: table for class "space": 0 bytes
[verbose] LC_CTYPE: table for class "print": 0 bytes
[verbose] LC_CTYPE: table for class "graph": 0 bytes
[verbose] LC_CTYPE: table for class "blank": 0 bytes
[verbose] LC_CTYPE: table for class "cntrl": 0 bytes
[verbose] LC_CTYPE: table for class "punct": 93978332474336 bytes
[verbose] LC_CTYPE: table for class "alnum": 93978332479632 bytes
[verbose] LC_CTYPE: table for class "combining": 93978332484912 bytes
[verbose] LC_CTYPE: table for class "combining_level3": 0 bytes
[verbose] LC_CTYPE: table for map "toupper": 1 bytes
[verbose] LC_CTYPE: table for map "tolower": 93978290741787 bytes
[verbose] LC_CTYPE: table for map "totitle": 16777524 bytes
[verbose] LC_CTYPE: table for width: 0 bytes
tumbleweed:~ # ll /usr/lib/locale | grep ru
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_RU
drwxr-xr-x 3 root root 4096 Feb 4 18:10 ru_RU.cp866
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_RU.koi8r
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_RU.utf8
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_UA
drwxr-xr-x 3 root root 4096 Feb 4 18:06 ru_UA.utf8
tumbleweed:~ # locale -a | grep ru
ru_RU
ru_RU.cp866
ru_RU.koi8r
ru_RU.utf8
ru_UA
ru_UA.utf8
tumbleweed:~ # cat /usr/lib/locale/ru_RU.cp866/LC_NAME
$345678%d%t%g%t%m%t%f IBM866
ru_RU.cp866 появляется, на полном TW этого достаточно, дальше export LC_CTYPE=ru_RU.cp866 и ок.
А в контейнере - No such file or directory
tumbleweed:~ # export LC_CTYPE=ru_RU.cp866
-bash: warning: setlocale: LC_CTYPE: cannot change locale (ru_RU.cp866): No such file or directory
tumbleweed:~ # export LC_ALL=ru_RU.cp866
-bash: warning: setlocale: LC_ALL: cannot change locale (ru_RU.cp866): No such file or directory
tumbleweed:~ # echo LC_CTYPE=ru_RU.cp866 > /etc/locale.conf
tumbleweed:~ # echo LC_ALL=ru_RU.cp866 >> /etc/locale.conf
tumbleweed:~ # echo LANG=ru_RU.cp866 >> /etc/locale.conf
tumbleweed:~ # logout
...
login as: root
-bash: warning: setlocale: LC_CTYPE: cannot change locale (ru_RU.cp866): No such file or directory
-bash: warning: setlocale: LC_ALL: cannot change locale (ru_RU.cp866): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (ru_RU.cp866): No such file or directory
-bash: warning: setlocale: LC_CTYPE: cannot change locale (ru_RU.cp866): No such file or directory
tumbleweed:~ # locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=POSIX
LC_CTYPE=ru_RU.cp866
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=
Подскажите, как определить, какого файла не хватает - No such file or directory ?
PS ru_RU.utf8 выставляется успешно
tumbleweed:/ # export LC_CTYPE=ru_RU.utf8
tumbleweed:/ # ll /usr/lib/locale/ru_RU.utf8/
total 2932
-rw-r--r-- 1 root root 165 Jan 20 16:33 LC_ADDRESS
-rw-r--r-- 194 root root 2586930 Jan 20 16:33 LC_COLLATE
-rw-r--r-- 217 root root 360460 Jan 20 16:33 LC_CTYPE
-rw-r--r-- 1 root root 341 Jan 20 16:33 LC_IDENTIFICATION
-rw-r--r-- 321 root root 23 Jan 20 16:33 LC_MEASUREMENT
drwxr-xr-x 2 root root 4096 Feb 4 18:06 LC_MESSAGES
-rw-r--r-- 6 root root 294 Jan 20 16:33 LC_MONETARY
-rw-r--r-- 139 root root 62 Jan 20 16:33 LC_NAME
-rw-r--r-- 38 root root 54 Jan 20 16:33 LC_NUMERIC
-rw-r--r-- 300 root root 34 Jan 20 16:33 LC_PAPER
-rw-r--r-- 11 root root 52 Jan 20 16:33 LC_TELEPHONE
-rw-r--r-- 2 root root 3416 Jan 20 16:33 LC_TIME
tumbleweed:/ # export LC_CTYPE=ru_RU.cp866
bash: warning: setlocale: LC_CTYPE: cannot change locale (ru_RU.cp866): No such file or directory
tumbleweed:/ # ll /usr/lib/locale/ru_RU.cp866/
total 372
-rw-r--r-- 1 root root 151 Feb 4 18:12 LC_ADDRESS
-rw-r--r-- 1 root root 23707 Feb 4 18:12 LC_COLLATE
-rw-r--r-- 1 root root 307984 Feb 4 18:12 LC_CTYPE
-rw-r--r-- 1 root root 342 Feb 4 18:12 LC_IDENTIFICATION
-rw-r--r-- 1 root root 24 Feb 4 18:12 LC_MEASUREMENT
drwxr-xr-x 2 root root 4096 Feb 4 18:12 LC_MESSAGES
-rw-r--r-- 1 root root 291 Feb 4 18:12 LC_MONETARY
-rw-r--r-- 1 root root 63 Feb 4 18:12 LC_NAME
-rw-r--r-- 1 root root 55 Feb 4 18:12 LC_NUMERIC
-rw-r--r-- 1 root root 35 Feb 4 18:12 LC_PAPER
-rw-r--r-- 1 root root 53 Feb 4 18:12 LC_TELEPHONE
-rw-r--r-- 1 root root 3136 Feb 4 18:12 LC_TIME