ubuntu服务器改语言,Ubuntu Server 更改系统语言

查看当前系统语言环境

$ locale

编辑配置文件,将zh_US.UTF-8改为en_US.UTF-8,zh改为en

$ sudo nano /etc/default/locale

LANG="en_US.UTF-8"

LANGUAGE="en_US:en"

$ sudo reboot

查看更改后的系统语言变量,如果出现下列错误,说明没安装en_US的local

nixonli@ubuntu:~$ locale

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory

LANG=en_US.UTF-8

LANGUAGE=en_US:en

LC_CTYPE="en_US.UTF-8"

LC_NUMERIC="en_US.UTF-8"

LC_TIME="en_US.UTF-8"

LC_COLLATE="en_US.UTF-8"

LC_MONETARY="en_US.UTF-8"

LC_MESSAGES="en_US.UTF-8"

LC_PAPER="en_US.UTF-8"

LC_NAME="en_US.UTF-8"

LC_ADDRESS="en_US.UTF-8"

LC_TELEPHONE="en_US.UTF-8"

LC_MEASUREMENT="en_US.UTF-8"

LC_IDENTIFICATION="en_US.UTF-8"

LC_ALL=

查看系统内安装的locale

nixonli@ubuntu:~$ locale -a

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_COLLATE to default locale: No such file or directory

C

POSIX

zh_CN.utf8

zh_SG.utf8

看没装en_US.UTF-8 安装en_US.UTF-8

安装中文语言包

apt-get install language-pack-zh

查看,应该一切正常了。

nixonli@ubuntu:/usr/share/locales$ locale

LANG=en_US.UTF-8

LANGUAGE=en_US:en

LC_CTYPE="en_US.UTF-8"

LC_NUMERIC="en_US.UTF-8"

LC_TIME="en_US.UTF-8"

LC_COLLATE="en_US.UTF-8"

LC_MONETARY="en_US.UTF-8"

LC_MESSAGES="en_US.UTF-8"

LC_PAPER="en_US.UTF-8"

LC_NAME="en_US.UTF-8"

LC_ADDRESS="en_US.UTF-8"

LC_TELEPHONE="en_US.UTF-8"

LC_MEASUREMENT="en_US.UTF-8"

LC_IDENTIFICATION="en_US.UTF-8"

LC_ALL=

你可能感兴趣的:(ubuntu服务器改语言)