пятница, 13 января 2012 г.

Установка locales Debian/Ubuntu

Если вам достался сервер, у которого, не установлена русская локаль,
и он временами сыплет подобными предупреждениями.

Для ubuntu:
...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "ru_RU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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
Selecting previously deselected package bash-completion.
(Reading database ... 23221 files and directories currently installed.)
Unpacking bash-completion (from .../bash-completion_1%3a1.3-1ubuntu3_all.deb) ...
Processing triggers for man-db ...
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
Setting up bash-completion (1:1.3-1ubuntu3) ...

...


Можно просто установить эту грешную локаль.
Ваш (КО) :-)))
apt-get install -y language-support-ru language-support-writing-ru \
 language-pack-ru language-pack-ru-base
да прибудет с вами русский
Generating locales...
  ru_RU.UTF-8... done
  ru_UA.UTF-8... done
Generation complete.
Setting up language-support-ru (1:10.04+20100311) ...
Setting up language-pack-ru (1:11.04+20110607) ...
Setting up language-pack-ru-base (1:11.04+20110607) ...
Generating locales...
  ru_RU.UTF-8... up-to-date
  ru_UA.UTF-8... up-to-date
Generation complete.
для Debian:
dpkg-reconfigure locales

Настройка пакета

          ###### Настраивается пакет locales #######
          # Локали, которые будут созданы:         # 
          #                                        # 
          #    [ ] ro_RO.UTF-8 UTF-8               # 
          #    [ ] ru_RU ISO-8859-5                # 
          #    [ ] ru_RU.CP1251 CP1251             # 
          #    [ ] ru_RU.KOI8-R KOI8-R             # 
          #    [*] ru_RU.UTF-8 UTF-8               # 
          #    [ ] ru_UA KOI8-U                    # 
          #    [ ] ru_UA.UTF-8 UTF-8               # 
          #    [ ] rw_RW UTF-8                     # 
          #                                        # 
          #                                        # 
          #        <Ok>            <Отмена>        # 
          #                                        # 
          ##########################################


Настройка пакета




        ######### Настраивается пакет locales #########
        # Локаль по умолчанию в системном окружении:  # 
        #                                             # 
        #                 Нет                         # 
        #                 ru_RU.UTF-8                 # 
        #                                             # 
        #                                             # 
        #          <Ok>              <Отмена>         # 
        #                                             # 
        ###############################################
Enhanced by Zemanta