Исправление ошибок «locale: Cannot set»

Зачастую, при заказе VPS или любого другого linux сервера, в нем оказываются не установлены все значения локали. Что приводит к появлению надоедливых сообщений при работе практически с любой программой:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory


Возможны и подобные ошибки:

Can't set locale; make sure $LC_* and $LANG are correct!
Can't set locale; make sure $LC_* and $LANG are correct!

Исправить локали и убрать данные ошибки можно одной лишь простой командой:

localedef ru_RU.UTF-8 -i ru_RU -f UTF-8
localedef ru_RU.UTF-8 -i ru_RU -f UTF-8

Если после выполнения команды у Вас появляется подобная ошибка:

# localedef ru_RU.UTF-8 -i ru_RU -f UTF-8
character map file `UTF-8' not found: No such file or directory
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory
# localedef ru_RU.UTF-8 -i ru_RU -f UTF-8
character map file `UTF-8' not found: No such file or directory
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory

То необходимо сначала установить пакет locales:

apt-get install locales
apt-get install locales
VN:F [1.9.22_1171]
Рейтинг: 9.3/10 (10 голоса(ов))
Исправление ошибок "locale: Cannot set", 9.3 out of 10 based on 10 ratings

1 Ответ

  1. Воспользовался Вашим советом, ответ системы:

    root@RT-N16-5BE8:/# localedef ru_RU.UTF-8 -i ru_RU -f UTF-8
    character map file `UTF-8′ not found: No such file or directory
    cannot read character map directory `/usr/share/i18n/charmaps’: No such file or directory
    root@RT-N16-5BE8:/# apt-get install locales
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    locales : Depends: glibc-2.13-1
    E: Unable to correct problems, you have held broken packages.

    Что порекомендуете?

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *