安装Ubuntu Server 11.10,先前的经历,由于选择Locale时无法选择China(可能我没有仔细的找),就选了Hongkong,结果从hk.ubuntu.org下载软件包缓慢得让人崩溃。后来的安装干脆直接选United States,安装程序运行到自动同步时间这一步,系统帮我选择了 Asia/Harbin,下载软件包用的是cn.ubuntu.org,速度很正常了。
但是在命令行执行指令时会提示Locale出错,运行 locale指令:
devadm@devserver:~$ localelocale: 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=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=zh_CN.UTF-8
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=zh_CN.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=
devadm@devserver:~$
查找ubuntu文档,找到了方法,安装zh_CN语言包:
devadm@devserver:~$ ls /usr/share/locales
install-language-pack remove-language-pack
devadm@devserver:~$ sudo /usr/share/locales/install-language-pack zh_CN
Generating locales...
zh_CN.UTF-8... done
Generation complete.
dpkg-trigger: error: must be called from a maintainer script (or with a --by-package option) 【这个错误提示暂时没有什么影响】
devadm@devserver:~$
devadm@devserver:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=zh_CN.UTF-8
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=zh_CN.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=
devadm@devserver:~$
好了。