在 Ubuntu Server 14.04 下临时切换 en_US.UTF-8、zh_CN.UTF-8 本地环境
在 Ubuntu Server 14.04 下临时切换 en_US.UTF-8、zh_CN.UTF-8 本地环境将 Ubuntu Server 14.04 本地环境 locale 永久修改为 en_US.UTF-8 或 zh_CN.UTF-8,德云社区已有相关主题。本主题将讲解如何将本地环境 “临时” 修改为 zh_CN.UTF-8 或 en_US.UTF-8。
1、将本地环境由 en_US.UTF-8 临时修改为 zh_CN.UTF-8:
root:~# export LANGUAGE=zh_CN.UTF-8
root:~# export LANG=zh_CN.UTF-8
root:~# export LC_ALL=zh_CN.UTF-8
root:~# locale-gen zh_CN.UTF-8
Generating locales...
zh_CN.UTF-8... up-to-date
Generation complete.
root:~# dpkg-reconfigure locales
Generating locales...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
zh_CN.UTF-8... up-to-date
Generation complete.
root:~# 查看是否已将 en_US.UTF-8 本地环境改为 zh_CN.UTF-8root:~# locale
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=zh_CN.UTF-8
root:~# 德云社区
德云社区: command not found
root:~# 广州德数
广州德数: command not found
root:~#2、将本地环境由 zh_CN.UTF-8 临时修改为 en_US.UTF-8:
root:~# export LANGUAGE=en_US.UTF-8
root:~# export LANG=en_US.UTF-8
root:~# export LC_ALL=en_US.UTF-8
root:~# locale-gen en_US.UTF-8
Generating locales...
en_US.UTF-8... up-to-date
Generation complete.
root:~# dpkg-reconfigure locales
Generating locales...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... up-to-date
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
zh_CN.UTF-8... done
Generation complete.
root:~# 查看是否已将 zh_CN.UTF-8 本地环境改为 en_US.UTF-8root:~# locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
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=en_US.UTF-8
root:~#.碌略粕缜
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
root:~#3、重启 Ubuntu Server 14.04 服务器后,本地环境又会自动恢复到原 en_US.UTF-8 或 zh_CN.UTF-8 状态下。
shutdown -r +1
版权声明:
本文为独家原创稿件,版权归 德云社区,未经许可不得转载;否则,将追究法律责任。
en_US, zh_CN, UTF-8, xshell, Ubuntu
在 Ubuntu Server 14.04 下临时切换 en_US.UTF-8、zh_CN.UTF-8 本地环境
en_US, zh_CN, UTF-8, xshell, Ubuntu
页:
[1]