1

Why does locale still throws me the errors below?

root@ubuntu:~# 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=
LANGUAGE=
LC_CTYPE=UTF-8
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=

This is my /etc/default/locale

LANG="en_US.UTF-8"
LANGUAGE="en_US:"
LC_ALL="en_US.UTF-8"

This is locale -a

root@ubuntu:~# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
C
C.UTF-8
POSIX
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US
en_US.iso88591
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8

Have tried rebooting and relogging in, but it doesn't seem to pick up the settings in /etd/default/locale.

2
  • Please, do not edit the question to post a solution. Add it as an answer instead and mark it accepted.
    – muru
    Sep 28, 2014 at 4:10
  • Sure, have moved my solution to the answer section. But I can only accept the answer after 2 days.
    – resting
    Sep 28, 2014 at 6:25

1 Answer 1

1

After more searching and experimenting with /etc/environment, I realize PAM authorization may have something to do with it.

I had the line UsePAM no in my /etc/ssh/sshd_config.
Revert it back to default which is UsePam yes and Ubuntu starts to pick up the changes in /etc/default/locale and /etc/environment again.
So the settings in /etc/default/locale actually worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .