4

On my VPS, when I type locale for a new user I get the following:

tarmac@vps48:~/log$ locale     
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
LANG=en_US.ISO-8859-15
LANGUAGE=en_US:en
LC_CTYPE="en_US.ISO-8859-15"
LC_NUMERIC="en_US.ISO-8859-15"
LC_TIME="en_US.ISO-8859-15"
LC_COLLATE="en_US.ISO-8859-15"
LC_MONETARY="en_US.ISO-8859-15"
LC_MESSAGES="en_US.ISO-8859-15"
LC_PAPER="en_US.ISO-8859-15"
LC_NAME="en_US.ISO-8859-15"
LC_ADDRESS="en_US.ISO-8859-15"
LC_TELEPHONE="en_US.ISO-8859-15"
LC_MEASUREMENT="en_US.ISO-8859-15"
LC_IDENTIFICATION="en_US.ISO-8859-15"
LC_ALL=

This obviously isn't correct because it throws me all sorts of warnings. How do I fix this?

2

You can manually create the missing locale definitions: sudo locale-gen en_US.ISO-8859-15.

Another option is to default to a different locale, for example C.UTF-8 or POSIX which should exist. To try, in bash: export LC_ALL=POSIX. If it works in an interactive session, you can add it to /etc/skel/.bashrc from where it can be picked up to new user home directories by adduser.

0

I had to use

locale-gen en

to fix this. The 'en' parameter was required and, to my surprise, other alternatives (such as en_GB or en_GB.UTF8) did not seem to work, whereas en did.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.