通過locale -a 顯示所有語言包都已安裝
現在有顯示中文的需要
要求 系統文字顯示正常,中文文件名正常顯示,以及vim編輯的文件能正常顯示中文。
我設置了/etc/profile以及/etc/sysconfig/i18n後,系統顯示都成了亂碼。設置.vimrc,用vim建文件中文依然亂碼。
安裝系統時選擇的英語,於是貌似沒有裝中文字體。如下幾部解決Linux中文支持問題。
1. yum install 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.
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做服務器就可以實現了。