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.

1 comment:

  1. I reboot but error persists:
    # ./install_stb.sh
    couldn't set locale correctly
    couldn't set locale correctly

    List of Services Tool Bundle Components:
    Oracle Explorer Data Collector 8.14
    Oracle Serial Number in EEPROM (SNEEP) 8.14
    Service Tag (ST) packages
    Oracle Autonomous Crashdump Tool 8.17 (ACT)

    Would you like to (I)nstall, (X)tract, or (E)xit ? (I by default)
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    couldn't set locale correctly
    #


    Then I edited from LC_MESSAGES=en.UTF-8 to LC_MESSAGES=C and my issue was solved:
    TZ=US/Eastern
    CMASK=022
    LC_COLLATE=en_US.UTF-8
    LC_CTYPE=en_US.UTF-8
    LC_MESSAGES=C
    LC_MONETARY=en_US.UTF-8
    LC_NUMERIC=en_US.UTF-8
    LC_TIME=en_US.UTF-8

    ReplyDelete