首页 > 代码库 > linux设置中文环境
linux设置中文环境
确认当前环境
[root@Oracle11g ~]# df –h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 2.0G 2.0G 0 100% /
/dev/sda6 388M 69M 299M 19% /var
/dev/sda3 5.7G 2.6G 2.9G 48% /usr
/dev/sda2 9.5G 4.2G 4.9G 46% /u01
tmpfs 497M 0 497M 0% /dev/shm
不是中文环境哦
安装中文包
[root@Oracle11g Server]# rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm
warning: fonts-chinese-3.02-12.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:fonts-chinese ########################################### [100%]
每个系统的包名不一样,请安装匹配的包
重启操作系统
[root@Oracle11g Server]# reboot
Broadcast message from root (pts/2) (Fri Nov 18 14:44:10 2016):
The system is going down for reboot NOW!
设置语言
选择中文语言
字符集一定要选择 UTF-8 哦
再次确认当前环境
修改用户环境变量
[root@Oracle11g ~]# vi /etc/sysconfig/i18n
#LANG="zh_cn.zhs16gbk"
LANG="zh_CN.UTF-8"
SYSFONT="lat0-sun16"
[oracle@Oracle11g ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
PATH=/sbin:/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
export LANG=zh_CN.UTF-8
[oracle@Oracle11g ~]$ source .bash_profile
最后附上CRT的设置
哈哈
linux设置中文环境