centos修改系统语言为中文

  • 5
  • 11,446 views
  • A+
所属分类:Linux

有些vps商家的centos模板是最小化minimal安装,显示中文可能碰到乱码,这个时候需要修改下系统语言。本文参考senra的博文。

Centos 6 :
vi /etc/sysconfig/i18n
将其中所有内容替换为如下

LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN:zh_CN.UTF-8"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"

Centos 7 :
localectl set-locale LANG=zh_CN.utf8
centos6和centos7都需要重启系统才会生效

另外,如果只想对当前账号进行语言修改,而不是系统全局修改的话,可以使用如下指令

echo 'export LC_ALL=zh_CN.utf8' >> ~/.bashrc

weinxin
我的微信公众号
我的微信公众号扫一扫

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:5   其中:访客  0   博主  0

    • E4rljia E4rljia 3

      Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

      然并卵啊,小伙子- –

        • 厘米 厘米 9

          Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

          @E4rljia 先记录一下,以后可能用得着。

            • E4rljia E4rljia 3

              Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

              @厘米 看下我网站,你会有惊喜的,网站footer

                • 厘米 厘米 9

                  Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

                  @E4rljia 看到了你的头像、简历 :mrgreen:

                    • e4rljia e4rljia 3

                      Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

                      @厘米 哈哈哈