Showing posts with label couldn't set locale correctly. Show all posts
Showing posts with label couldn't set locale correctly. Show all posts

Tuesday, April 19, 2011

Solaris 10: Changing Your System Language Settings via Console

Abstract: Recently while setting up a new server, I accidentally set the default language to Espanol UTF-8 instead of the intended English UTF-8(hey, it happens). Here's how I resolved the issue.

Extract:

1) Log in as superuser:

$ su
PASSWORD: #####

2) Ensure that the language you want is available(excerpted response follows):

# ls /usr/lib/locale

...
C
POSIX
common
en_US.UTF-8
es
es.UTF-8
geo
en_US

If the language is not installed, consult http://developers.sun.com/global/products_platforms/solaris/reference/faqs/solaris-10-locale-packages.html for more information.

3) Edit the start-up default language settings:

# vi /etc/default/init

...
TZ=US/Eastern
CMASK=022
LC_COLLATE=es.UTF-8
LC_CTYPE=es.UTF-8
LC_MESSAGES=es.UTF-8
LC_MONETARY=es.UTF-8
LC_NUMERIC=es.UTF-8
LC_TIME=es.UTF-8

I changed the file to:

...
TZ=US/Eastern
CMASK=022
LC_COLLATE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8

4) Reboot.

Troubleshooting:

When logging in, if you see the error: "couldn't set locale correctly", the language was probably misspelled or miscapitalized. Try the above steps again.