如何让 centos6.5 terminal 可以显示中文?系统仍然显示英文

问题:
系统安装的时候选择的美国英语语言环境。
通过locale -a 显示所有语言包都已安装

现在有显示中文的需要
要求 系统文字显示正常,中文文件名正常显示,以及vim编辑的文件能正常显示中文。

我设置了/etc/profile以及/etc/sysconfig/i18n后,系统显示都成了乱码。设置.vimrc,用vim建文件中文依然乱码。


答案1:
安装系统时选择的英语,于是貌似没有装中文字体。如下几部解决Linux中文支持问题。

1. yum install fonts-chinese
这里遇到了问题,就是我的源无法支持下载fonts-chinese
尝试了这个:yum groupinstall "Chinese Support"发现也没有用。
I think I fond where the problem lie after yesterday's two hours fruitless struggle.
The problem is my yum repositories has been installed unsuccessfully, especially I have not imported keys.
To change the repository copy the following codes:

# CentOS-Base.repo 

# This file uses a new mirrorlist system developed by Lance Davis for CentOS. 
# The mirror system uses the connecting IP address of the client and the 
# update status of each mirror to pick mirrors that are updated to and 
# geographically close to the client. You should use this for CentOS updates 
# unless you are manually picking other mirrors. 

# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead. 



[base] 
name=CentOS-$releasever - Base 
baseurl=http://mirrors.sohu.com/centos/6.5/os/$basearch/ 
gpgcheck=1 
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6 

#released updates 
[updates] 
name=CentOS-$releasever - Updates 
baseurl=http://mirrors.sohu.com/centos/6.5/updates/$basearch/ 
gpgcheck=1 
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6 

#packages used/produced in the build but not released 
#[addons] 
#name=CentOS-$releasever - Addons 
#baseurl=http://mirrors.sohu.com/centos/$releasever/addons/$basearch/ 
#gpgcheck=1 
#gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6 
#additional packages that may be useful 
[extras] 
name=CentOS-$releasever - Extras 
baseurl=http://mirrors.sohu.com/centos/6.5/extras/$basearch/ 
gpgcheck=1 
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6 
#additional packages that extend functionality of existing packages 
[centosplus] 
name=CentOS-$releasever - Plus 
baseurl=http://mirrors.sohu.com/centos/6.5/centosplus/$basearch/ 
gpgcheck=1 
enabled=0 
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6

copy this commands and saved as a file named CentOS-Base.repo under the directory: /etc/yum.repos.d(make sure that .repo files only include CentOS-Base.repo;CentOS.Debuginfo.repo;CentOS-Vault.repo and CentOS-Media.repo)

CentOS-Base.repo 是yum 网络源的配置文件

 

CentOS-Media.repo 是yum 本地源的配置文件

and then download and import the key using the following lines

wget mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6

rpm --import RPM-GPG-KEY-CentOS-6

then enjoy the fast speed of yum!

even I have changed the repository to sohu repository but cannot also fond the fonts-chinese maybe I should try cstu repository.

2. vim /etc/sysconfig/i18n

LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"

3. vim ~/.vimrc
set termencoding=gbk
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8

4. vim /etc/profile
export LC_ALL=zh_CN.GB18030

第四部不做不知道好不好用。反正我是这样设置的。

5.  安装中文输入法
yum install scim
yum install scim-pinyin 

6. 终端secureCRT显示中文
session options --->appearance--->character encoding 设置成简体中文。

于是所有中文问题都解决了。

答案2

CentOS6字符界面下面目前没有中文显示的方案。

以前的版本中文显示是安装zhcon来实现的。

如果安装了中文支持的话,用SSH连接时可以显示中文。

我用putty链接linux做服务器就可以实现了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章