Quantcast
Channel: C++博客-所有随笔
Viewing all articles
Browse latest Browse all 7882

debian 系统修改语言设置成英文

$
0
0
root@debian:~# vi /etc/default/locale 
root@debian:
~# dpkg-reconfigure locales
Generating locales (
this might take a while)
  en_US.UTF
-8 done
  zh_CN.UTF
-8 done
Generation complete.
root@debian:
~# cat /etc/default/locale 
#  File generated by update
-locale
LANG
=en_US.UTF-8
LANGUAGE
="en_US:en"
root@debian:
~# reboot


今天安装了一个Debian的虚拟机,安装的时候本来想选英语的,但是时区只能用美国的时区,于是就换上了中文的,没有提示选择时区。

发现在shell中文还是乱码,于是毅然的把语言更改成英语的。打开文件locale

sudo vi /etc/default/locale

显示

LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh"

将其内容更改成

LANG="en_US.UTF-8" LANGUAGE="en_US:en"

然后重启reboot机器。

在修改的过程中,vi已经忘记了差不多了,导致修改起来非常纠结,勉强给修改完成。后来想给debian安装一个vim的,提示找不到定位源。后来运行了apt-get update后可以安装了。


虽然之前的能够将中文改成英文,但是在使用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


dpkg-reconfigure locales

修改,在选项中选择en-US.UTF-8 按空格选中。然后简单的按 ok 键就好了。这下才算正确把中文环境的系统更换成英文的环境的系统。



聂文龙 2013-06-02 13:36 发表评论

Viewing all articles
Browse latest Browse all 7882

Trending Articles