Após instalação do debian 8 me deparei com o seguinte erro na console relativo ao locale
root@server01:/usr/src# apt-get update; apt-get upgrade
Ign http://ftp.br.debian.org jessie InRelease
Get:1 http://ftp.br.debian.org jessie-updates InRelease [142 kB]
Get:2 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:3 http://ftp.br.debian.org jessie Release.gpg [2373 B]
Get:4 http://ftp.br.debian.org jessie Release [148 kB]
Get:5 http://security.debian.org jessie/updates/main Sources [136 kB]
Get:6 http://ftp.br.debian.org jessie-updates/main Sources [14.1 kB]
Get:7 http://ftp.br.debian.org jessie-updates/contrib Sources [32 B]
Get:8 http://security.debian.org jessie/updates/contrib Sources [1439 B]
Get:9 http://ftp.br.debian.org jessie-updates/non-free Sources [920 B]
Get:10 http://security.debian.org jessie/updates/non-free Sources [14 B]
Get:11 http://ftp.br.debian.org jessie-updates/main amd64 Packages/DiffIndex [3472 B]
Get:12 http://security.debian.org jessie/updates/main amd64 Packages [247 kB]
Get:13 http://ftp.br.debian.org jessie-updates/contrib amd64 Packages [32 B]
Get:14 http://security.debian.org jessie/updates/contrib amd64 Packages [2506 B]
Get:15 http://ftp.br.debian.org jessie-updates/non-free amd64 Packages/DiffIndex [736 B]
Get:16 http://ftp.br.debian.org jessie-updates/contrib Translation-en [14 B]
Get:17 http://security.debian.org jessie/updates/non-free amd64 Packages [14 B]
Get:18 http://ftp.br.debian.org jessie-updates/main Translation-en/DiffIndex [1720 B]
Get:19 http://security.debian.org jessie/updates/contrib Translation-en [1211 B]
Get:20 http://security.debian.org jessie/updates/main Translation-en [135 kB]
Get:21 http://ftp.br.debian.org jessie-updates/non-free Translation-en/DiffIndex [736 B]
Get:22 http://security.debian.org jessie/updates/non-free Translation-en [14 B]
Get:23 http://ftp.br.debian.org jessie/main Sources [7059 kB]
Get:24 http://ftp.br.debian.org jessie/contrib Sources [50.7 kB]
Get:25 http://ftp.br.debian.org jessie/non-free Sources [99.2 kB]
Get:26 http://ftp.br.debian.org jessie/main amd64 Packages [6763 kB]
Get:27 http://ftp.br.debian.org jessie/contrib amd64 Packages [50.1 kB]
Get:28 http://ftp.br.debian.org jessie/non-free amd64 Packages [83.6 kB]
Get:29 http://ftp.br.debian.org jessie/contrib Translation-en [38.5 kB]
Get:30 http://ftp.br.debian.org jessie/main Translation-en [4581 kB]
Get:31 http://ftp.br.debian.org jessie/main Translation-pt_BR [803 kB]
Get:32 http://ftp.br.debian.org jessie/main Translation-pt [413 kB]
Get:33 http://ftp.br.debian.org jessie/non-free Translation-en [72.5 kB]
Fetched 20.9 MB in 5s (4020 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
libexpat1 libexpat1-dev
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 206 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/ jessie/updates/main libexpat1-dev amd64 2.1.0-6+deb8u2 [126 kB]
Get:2 http://security.debian.org/ jessie/updates/main libexpat1 amd64 2.1.0-6+deb8u2 [79.4 kB]
Fetched 206 kB in 0s (3285 kB/s)
Can't set locale; make sure $LC_* and $LANG are correct!
Lendo logs de mudanças... Feito
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "pt_BR:pt:en",
LC_ALL = (unset),
LC_TIME = "pt_PT.UTF-8",
LC_MONETARY = "pt_PT.UTF-8",
LC_ADDRESS = "pt_PT.UTF-8",
LC_TELEPHONE = "pt_PT.UTF-8",
LC_NAME = "pt_PT.UTF-8",
LC_MEASUREMENT = "pt_PT.UTF-8",
LC_IDENTIFICATION = "pt_PT.UTF-8",
LC_NUMERIC = "pt_PT.UTF-8",
LC_PAPER = "pt_PT.UTF-8",
LANG = "pt_BR.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("pt_BR.UTF-8").
locale: Cannot set LC_ALL to default locale: Arquivo ou diretório não encontrado
(Reading database ... 45208 files and directories currently installed.)
Preparing to unpack .../libexpat1-dev_2.1.0-6+deb8u2_amd64.deb ...
Unpacking libexpat1-dev:amd64 (2.1.0-6+deb8u2) over (2.1.0-6+deb8u1) ...
Preparing to unpack .../libexpat1_2.1.0-6+deb8u2_amd64.deb ...
Unpacking libexpat1:amd64 (2.1.0-6+deb8u2) over (2.1.0-6+deb8u1) ...
Setting up libexpat1:amd64 (2.1.0-6+deb8u2) ...
Setting up libexpat1-dev:amd64 (2.1.0-6+deb8u2) ...
Processing triggers for libc-bin (2.19-18+deb8u4) ...
Para corrigir o problema execute os seguintes comandos
locale-gen en_US en_US.UTF-8 pt_BR.UTF-8
dpkg-reconfigure locales
em seguida clique em ok na janela e depois edite o arquivo profile conforme o comando abaixo:
vim /etc/profile
e adicione a linha abaixo:
export LC_ALL=pt_BR.UTF-8
Por fim, faça logout e novamente login via ssh e digite o comando locale e se tudo correu bem, não ocorrerá o erro novamente.
root@server01:/usr/src# locale
LANG=pt_BR.UTF-8
LANGUAGE=pt_BR:pt:en
LC_CTYPE="pt_BR.UTF-8"
LC_NUMERIC="pt_BR.UTF-8"
LC_TIME="pt_BR.UTF-8"
LC_COLLATE="pt_BR.UTF-8"
LC_MONETARY="pt_BR.UTF-8"
LC_MESSAGES="pt_BR.UTF-8"
LC_PAPER="pt_BR.UTF-8"
LC_NAME="pt_BR.UTF-8"
LC_ADDRESS="pt_BR.UTF-8"
LC_TELEPHONE="pt_BR.UTF-8"
LC_MEASUREMENT="pt_BR.UTF-8"
LC_IDENTIFICATION="pt_BR.UTF-8"
LC_ALL=pt_BR.UTF-8