Changing default system locale on CentOS 5

5,633

Try

grep -r "zh_CN.GB18030" /etc

and see where it gets set.

Share:
5,633

Related videos on Youtube

samxli
Author by

samxli

Independent developer working on various projects at a startup.

Updated on September 18, 2022

Comments

  • samxli
    samxli over 1 year

    I'm running a CentOS 5 server and the current default locale seems to be always set as:

    LANG=zh_CN.GB18030
    LC_CTYPE="zh_CN.GB18030"
    LC_NUMERIC="zh_CN.GB18030"
    LC_TIME="zh_CN.GB18030"
    LC_COLLATE="zh_CN.GB18030"
    LC_MONETARY="zh_CN.GB18030"
    LC_MESSAGES="zh_CN.GB18030"
    LC_PAPER="zh_CN.GB18030"
    LC_NAME="zh_CN.GB18030"
    LC_ADDRESS="zh_CN.GB18030"
    LC_TELEPHONE="zh_CN.GB18030"
    LC_MEASUREMENT="zh_CN.GB18030"
    LC_IDENTIFICATION="zh_CN.GB18030"
    LC_ALL=zh_CN.GB18030
    

    When I run

    export LC_ALL=en_US.UTF-8
    export LANG=en_US.UTF-8
    

    Things seem to work fine until I restart my system or relogin; it returns to Chinese again. I checked my /etc/sysconfig/i18n config and it reads:

    LANG="en_US.UTF-8"
    SYSFONT="latarcyrheb-sun16"
    

    Cant's seem to figure out other ways to set the default system locale. I don't want to do it in .bashrc or .bash_profile because I want it to be globally set for the system. What to do?

  • samxli
    samxli over 12 years
    cloud hosting provider changed the profile file to do export LANG="zh_CN.GB18030"...