上网搜索Linux中文乱码问题,提示需要安装
fonts-chinese-3.02-12.el5.noarch.rpm
fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
中文语言包yum安装方式提示找不到,怀疑是网络问题,改用从网站
http://rpmfind.net/linux/rpm2html
下载,使用rpm安装方式
直接安装提示:缺少chkfontpath依赖包
安装依赖chkfontpath提示:
[root@RedHat-BG home]# rpm -ivh chkfontpath-1.10.1-7mdv2011.0.x86_64.rpm
warning: chkfontpath-1.10.1-7mdv2011.0.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 78d019f5: NOKEY
error: Failed dependencies:
xfs is needed by chkfontpath-1.10.1-7mdv2011.0.x86_64
[root@RedHat-BG home]# rpm -ivh xfs-1.1.2-1-mdv2012.0.x86_64.rpm
warning: xfs-1.1.2-1-mdv2012.0.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 26752624: NOKEY
error: Failed dependencies:
rpm-helper is needed by xfs-1.1.2-1.x86_64
fslsfonts is needed by xfs-1.1.2-1.x86_64
fstobdf is needed by xfs-1.1.2-1.x86_64
showfont is needed by xfs-1.1.2-1.x86_64
x11-server-common >= 1.4.0.90-13mdv is needed by xfs-1.1.2-1.x86_64
libxfont >= 1.2.8-2mdv is needed by xfs-1.1.2-1.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by xfs-1.1.2-1.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by xfs-1.1.2-1.x86_64
上网搜索找到这样一段文字:
安装
/bin/sh is needed by fonts-chinese-3.02-12.el5.noarch
/usr/sbin/chkfontpath is needed by fonts-chinese-3.02-12.el5.noarch
fontconfig is needed by fonts-chinese-3.02-12.el5.noarch
mkfontdir is needed by fonts-chinese-3.02-12.el5.noarch
ttmkfdir >= 3.0.6 is needed by fonts-chinese-3.02-12.el5.noarch
这几个提示你缺少依赖的包
这样再安装依赖包
[root@RedHat-BG home]# rpm -ivh rpm-helper-0.24.17-4.mga6.noarch.rpm
warning: rpm-helper-0.24.17-4.mga6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID 80420f66: NOKEY
error: Failed dependencies:
perl-base >= 2:5.22.1 is needed by rpm-helper-0.24.17-4.mga6.noarch
systemd-units is needed by rpm-helper-0.24.17-4.mga6.noarch
util-linux >= 2.24-1 is needed by rpm-helper-0.24.17-4.mga6.noarch
You have mail in /var/spool/mail/root
这样就陷入没完没了找依赖,上网搜索其他文章:xfs is needed by
找到:
centos/redhat中文支持安装
一般而言,我们在安装linux时可能没有安装中文字体,导致我们在使用不管是linux桌面还是命令行终端时,中文显示乱码,也不能输入中文。下面,我将交大家怎么在linux中安装中文字体并配置显示。
软件包,http://pan.baidu.com/s/1qW2TE7i
可能要使用的软件
-
chkfontpath-1.10.1-1.1.i386.rpm
fonts-chinese-3.02-12.el5.noarch.rpm
fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
libFS-1.0.0-3.1.i386.rpm
ttmkfdir-3.0.9-23.el5.i386.rpm
xorg-x11-xfs-1.0.2-4.i386.rpm
其中
fonts-chinese-3.02-12.el5.noarch.rpm
fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
这两个是最主要的。
直接安装这两个软件
-
rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm
rpm -ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
但如果你之前没有安装xwindow,可能在安装第一个软件时就会出错,如下图。
-
我们再安装错误中出现的软件,又会出现报错。如图。
-
这时,需要安装更多的依赖软件。我们依次安装
rpm -ivh ./libFS-1.0.0-3.1.i386.rpm
rpm -ivh ./ttmkfdir-3.0.9-23.el5.i386.rpm
-
然后将下面两个软件一起安装,不然会出现循环依赖。
rpm -ivh ./chkfontpath-1.10.1-1.1.i386.rpm ./xorg-x11-xfs-1.0.2-4.i386.rpm
-
然后再依次安装第二步中的两个软件。
rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm
rpm -ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
-
安装完成之后,重启系统。在登录时可以从最下面,选择桌面系统中显示中文。
-
如果要在命令行终端中显示中文、在xshell中显示、输入中文,则需要修改/etc/sysconfig/i18n文件
修改字体文档
#vi /etc/sysconfig/i18n
将LANG="en_US.UTF-8"SYSFONT="latarcyrheb-sun16"修改原内容为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"
-
效果如下
-
其实还有第二种简单的方法
yum -y groupinstall chinese-support
这样自动安装。
版本问题造成冲突
[root@RedHat-BG home]# rpm -ivh ./libFS-1.0.7-6.fc27.i686.rpm
warning: ./libFS-1.0.7-6.fc27.i686.rpm: Header V3 RSA/SHA256 Signature, key ID f5282ee4: NOKEY
error: Failed dependencies:
libc.so.6(GLIBC_2.15) is needed by libFS-1.0.7-6.fc27.i686
[root@RedHat-BG home]# rpm -ivh glibc-2.17-5.mga3.x86_64.rpm \
> ^C
[root@RedHat-BG home]# rpm -ivh glibc-2.17-5.mga3.x86_64.rpm \
> ^C
[root@RedHat-BG home]# rpm -ivh glibc-2.17-5.mga3.x86_64.rpm
warning: glibc-2.17-5.mga3.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 80420f66: NOKEY
error: Failed dependencies:
dash-static is needed by glibc-6:2.17-5.mga3.x86_64
/usr/bin/dash.static is needed by glibc-6:2.17-5.mga3.x86_64
prelink < 1:0.4.2-1.20091104.1 conflicts with glibc-6:2.17-5.mga3.x86_64
kernel < 2.6.33 conflicts with glibc-6:2.17-5.mga3.x86_64
[root@RedHat-BG home]# rpm -ivh glibc-2.14.1-11.2.mga2.x86_64.rpm
warning: glibc-2.14.1-11.2.mga2.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 80420f66: NOKEY
error: Failed dependencies:
dash-static is needed by glibc-6:2.14.1-11.2.mga2.x86_64
/bin/dash.static is needed by glibc-6:2.14.1-11.2.mga2.x86_64
prelink < 1:0.4.2-1.20091104.1 conflicts with glibc-6:2.14.1-11.2.mga2.x86_64
[root@RedHat-BG home]# rpm -ivh dash-static-0.5.9-1.mga6.x86_64.rpm
warning: dash-static-0.5.9-1.mga6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 80420f66: NOKEY
Preparing... ########################################### [100%]
1:dash-static ########################################### [100%]
[root@RedHat-BG home]# rpm -ivh glibc-2.14.1-11.2.mga2.x86_64.rpm
warning: glibc-2.14.1-11.2.mga2.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 80420f66: NOKEY
error: Failed dependencies:
prelink < 1:0.4.2-1.20091104.1 conflicts with glibc-6:2.14.1-11.2.mga2.x86_64
[root@RedHat-BG home]# rpm -ivh ./libFS-1.0.7-6.fc27.i686.rpm
warning: ./libFS-1.0.7-6.fc27.i686.rpm: Header V3 RSA/SHA256 Signature, key ID f5282ee4: NOKEY
error: Failed dependencies:
libc.so.6(GLIBC_2.15) is needed by libFS-1.0.7-6.fc27.i686
[root@RedHat-BG home]# rpm -ivh glibc-2.16.90-3-mdv2012.0.x86_64.rpm
warning: glibc-2.16.90-3-mdv2012.0.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 26752624: NOKEY
error: Failed dependencies:
prelink < 1:0.4.2-1.20091104.1mdv2010.1 conflicts with glibc-6:2.16.90-3.x86_64
[root@RedHat-BG home]# rpm -ivh libc6-2.16.90-3-mdv2012.0.x86_64.rpm
warning: libc6-2.16.90-3-mdv2012.0.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 26752624: NOKEY
error: Failed dependencies:
glibc < 6:2.14.90-13 conflicts with libc6-6:2.16.90-3.x86_64
[root@RedHat-BG home]# rpm -ivh libFS-1.0.7-6.fc27.i686.rpm
warning: libFS-1.0.7-6.fc27.i686.rpm: Header V3 RSA/SHA256 Signature, key ID f5282ee4: NOKEY
error: Failed dependencies:
libc.so.6(GLIBC_2.15) is needed by libFS-1.0.7-6.fc27.i686
冲突问题的搜索:
1
|
I have a 64-bit Redhat Enterprise Linux server (version 6.3) that doesn't want to let me install the glibc.i686 module for 32-bit compatibility. When I try
|
解答:
1
|
There is no This of course puts your RPM database in an inconsistent state relative to the actual software installed, and may cause compatibility and dependency problems such as that you ran into today. It becomes no longer possible to update packages from the supported repositories, for instance, and difficult to determine exactly what code is running on the system. My best guess is that someone (who really doesn't know the right way to do this) attempted to upgrade glibc beyond the version provided by Red Hat, most likely to take advantage of a new feature which isn't present in the version of glibc shipped with EL6. The right way, if you really need this late version of glibc, is to take Red Hat's source RPM, tweak the spec file and any patches to build the new version of glibc, and use the new binary RPMs of the new version. You then are responsible for maintaining it yourself, may lose vendor support, etc. so this is something you should only think about if business requirements absolutely demand it. (And since you lose your support anyway, you may as well switch to CentOS...) |
||||
|
可知冲突和已安装的不同的软件包相互匹配版本有关
降低下载版本:
[root@RedHat-BG home]# rpm -ivh libFS-1.0.1-5.el6.x86_64.rpm
warning: libFS-1.0.1-5.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 66534c2b: NOKEY
Preparing... ########################################### [100%]
1:libFS ########################################### [100%]
[root@RedHat-BG home]# rpm -ivh ttmkfdir-3.0.9-51.fc27.x86_64.rpm
warning: ttmkfdir-3.0.9-51.fc27.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 9db62fb1: NOKEY
error: Failed dependencies:
libc.so.6(GLIBC_2.14)(64bit) is needed by ttmkfdir-3.0.9-51.fc27.x86_64
libstdc++.so.6(CXXABI_1.3.8)(64bit) is needed by ttmkfdir-3.0.9-51.fc27.x86_64
libstdc++.so.6(CXXABI_1.3.9)(64bit) is needed by ttmkfdir-3.0.9-51.fc27.x86_64
libstdc++.so.6(GLIBCXX_3.4.20)(64bit) is needed by ttmkfdir-3.0.9-51.fc27.x86_64
libstdc++.so.6(GLIBCXX_3.4.21)(64bit) is needed by ttmkfdir-3.0.9-51.fc27.x86_64
[root@RedHat-BG home]# rpm -ivh ttmkfdir-3.0.9-2-mdv2011.0.x86_64.rpm
warning: ttmkfdir-3.0.9-2-mdv2011.0.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 26752624: NOKEY
Preparing... ########################################### [100%]
package ttmkfdir-3.0.9-32.1.el6.x86_64 (which is newer than ttmkfdir-3.0.9-2.x86_64) is already installed
file /usr/bin/ttmkfdir from install of ttmkfdir-3.0.9-2.x86_64 conflicts with file from package ttmkfdir-3.0.9-32.1.el6.x86_64
[root@RedHat-BG home]# rpm -ivh ./chkfontpath-1.10.1-7mdv2011.0.x86_64.rpm ./xorg-x11-xfs-1.0.5-7.el6.x86_64.rpm
warning: ./chkfontpath-1.10.1-7mdv2011.0.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 78d019f5: NOKEY
warning: ./xorg-x11-xfs-1.0.5-7.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 66534c2b: NOKEY
Preparing... ########################################### [100%]
1:xorg-x11-xfs ########################################### [ 50%]
2:chkfontpath ########################################### [100%]
[root@RedHat-BG home]# rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm
warning: fonts-chinese-3.02-12.el5.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 37017186: NOKEY
Preparing... ########################################### [100%]
1:fonts-chinese ########################################### [100%]
[root@RedHat-BG home]# rpm -ivh iso8859-2-75dpi-fonts-1.0-34.fc27.noarch.rpm
warning: iso8859-2-75dpi-fonts-1.0-34.fc27.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f5282ee4: NOKEY
error: Failed dependencies:
iso8859-2-fonts-common = 1.0-34.fc27 is needed by iso8859-2-75dpi-fonts-1.0-34.fc27.noarch
[root@RedHat-BG home]# rpm -ivh iso8859-2-fonts-common-1.0-34.fc27.noarch.rpm
warning: iso8859-2-fonts-common-1.0-34.fc27.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f5282ee4: NOKEY
Preparing... ########################################### [100%]
1:iso8859-2-fonts-common ########################################### [100%]
[root@RedHat-BG home]# rpm -ivh iso8859-2-75dpi-fonts-1.0-34.fc27.noarch.rpm
warning: iso8859-2-75dpi-fonts-1.0-34.fc27.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f5282ee4: NOKEY
Preparing... ########################################### [100%]
1:iso8859-2-75dpi-fonts ########################################### [100%]
各种依赖包安装成功。
linux安装中文语言包
相关配置如下: yum install fonts-chinese.noarch
yum install m17n-db-common-cjk
yum install m17n-db-chinese
安装上面的几个语言包重启就正常了
yum groupinstall chinese-support
CentOS 5.0 安装中文语言包以及输入法
语言包的安装方法有三个。两个Yum方式的,一个rpm方式的。
其一:yum方式——完全的中文环境支持。这个方式的缺点是要从FTP上下载安装包,下载的包的数量虽然可以选择,但仍然是个不小的量。
以root身份登陆,运行命令:
yum groupinstall <language>-support
在上面的命令中,<language> 是下列之一: assamese, bengali, chinese, gujarati, hindi, japanese, kannada, korean, malayalam, marathi, oriya, punjabi, sinhala, tamil, thai, 或 telegu。
若提示如下错误信息
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum-updatesd-he
Memory : 15 M RSS ( 27 MB VSZ)
Started: Sat Apr 10 13:34:25 2010 - 09:39 ago
State : Sleeping, pid: 3008
则可以用 ps -U root 和kill命令来结束正在占用Yum的程序,然后再次执行上面的命令。
其二:还是yum方式,但是命令是:
yum install fonts-chinese fonts-ISO8859-2-75dpi
该方式的第一个包貌似也不小。
其三:rpm方式。在安装盘上已经有各种语言包了,我们只需要找到他们,并安装就可以了。中文的是
fonts-chinese-3.02-9.6.el5.noarch.rpm
fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
我用的是6CD的安装盘,第一个包在4of6盘上,第二个在6of6盘上,
进入各文件对应目录,运行下面命令:
#rpm -ivh fonts-chinese-3.02-9.6.el5.noarch.rpm
#rpm -ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
中文输入法按如下安装:
rpm -ivh scim-1.4.4-41.el5.i386.rpm
rpm -ivh scim-pinyin-0.5.91-16.el5.i386.rpm
rpm -ivh scim-tables-0.5.6-7.i386.rpm
rpm -ivh scim-tables-additional-0.5.6-7.i386.rpm
rpm -ivh scim-tables-chinese-0.5.6-7.i386.rpm
注:这些也在安装盘上,仍需要以root运行。具体版本可能有所变化。
Linux中文显示乱码?如何设置centos显示中文
Linux怎么查看设置系统语言包
-
查看当前系统语言
登陆linux系统打开操作终端之后,输入 echo $LANG可以查看当前使用的系统语言。如
-
查看安装的语言包
查看是否有中文语言包可以在终端输入 locale命令,如有zh cn 表示已经安装了中文语言
-
如果没有中文语言呢
可以通过网上下载安装中文语言包yum groupinstall chinese-support(不能联网的通过其他电脑下载,上传上去吧)
-
如何修改系统语言为中文
1 临时更换语言
如果只是临时更换linux系统的语言环境,可以通过输入设置 LANG=语言名称, 如中文是
Zn_CN.UTF-8(注意我这里本来就是中文的,我临时设置为英文
-
修改系统默认语言
以上方法是通过修改设置系统默认的语言配置
如Vi /etc/sysconfig/i18n (注意改好之后重启一下系统)
-
其他注意事项
如果按照以上方法设置修改设置中文语言还是不行的话,注意您的链接终端选择的编码。
如xshell为例,把终端的编码选择中文,或者UTF8即可
-
设置好之后,再次查看之前的乱码文件就能看到显示为中文了
-
后记:
想尽办法:安装和切换中文环境后RedHat崩溃:虚拟机重置
仍然不好使,这样,在登录输入用户名root后发现下面有语言选择,设置回英文,应用新语言文件夹名,终于还原!!
重新编辑文件和设置LANG变量:
vi /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
SYSFONT="latarcyrheb-sun16"
和
修改LANG系统变量为:
LANG="zh_CN.UTF-8"------------------------------------------------------------这是个临时设置!!
[root@RedHat-BG ~]# echo $LANG
zh_CN.UTF-8
重启登录,输入用户名root后在最下方的语言选择上选择中文-UTF-8
拖入虚拟机一个中文文件,显式中文成功!!
按Ctrl+Space组合键,即可实现中英文切换,中文输入!!
将这个过程改为en_US.UTF-8,则恢复为英文界面(X_Windows)和编码!!
1、首先, 保证环境变量 LC_CTYPE 必须是zh_CN.UTF-8
locale可查看此变量的值。
2、桌面程序(GNOME, KDE)要安装 字体文件, 之后还要设置桌面的语言选项。KDE桌面, 则可以在"控制中心"设置。 字体文件可以从LINUX系统光盘里获得。
改变redhat的系统语言/字符集 简体中文语言包的安装
改变redhat的系统语言/字符集 简体中文语言包的安装
2008-11-27 11:28 A.M.
|
VIM字符集编码设置
vim字符编码设置
设置Ubuntu系统和Vim字符集为utf8
Ubuntu编码设置
首先我们将ubuntu系统设置为utf8的字符集:
假设我们安装中文包:
1、安装中文语言包
Shell>apt-get
2、用vim配置语言环境变量
Shell>vim
Shell>vim
在下面添加如下两行
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh:en_US:en"
如果你想用英文环境了,改成这两行就OK
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
3、重启Ubuntu
reboot
4、可以用locale查看一下环境变量...
locale
Vim编码设置
Shell>vim
let
set