美文网首页
linux之修改系统语言

linux之修改系统语言

作者: 信仰与初衷 | 来源:发表于2018-07-01 11:32 被阅读0次

    Ubuntu/debian

    • 1.临时设置
    export LANG=zh_CN.UTF-8
    
    • 2.永久设置
    dpkg-reconfigure locales 
    

    如果提示语言包没有,请重新安装locale sudo apt-get install locale

    配置完重启

    Centos/Redhat

    • 1.临时设置
    export LANG=zh_CN.UTF-8
    
    • 2.永久设置

      修改语言配置文件

      • centos 6
      vim /etc/sysconfig/i18n
      
      • centos 7
      vim /etc/locale.conf
      

      加入下面这句(这里用en_US.UTF-8为例,修改中文zh_CN.UTF-8或者zh_CN.GBK)

      LANG="en_US.UTF-8"
      

      然后

      source /etc/sysconfig/i18n 
      或
      source /etc/locale.conf
      

    当然也可以将export LANG="en_US.UTF-8"加入到/etc/profile或者~/bashrc,然后保存,source [文件名],这样也可以修改成功,具体怎么修改系统语言,可以根据你的需求来修改。

    相关文章

      网友评论

          本文标题:linux之修改系统语言

          本文链接:https://www.haomeiwen.com/subject/bxycuftx.html