记一次RedHat中文乱码,中文语言包安装实践

这篇博客记录了在RedHat系统中遇到的中文乱码问题及其解决过程。首先,作者尝试通过yum安装中文语言包,但遇到了依赖问题。然后,作者从网络上下载了所需的rpm包,包括fonts-chinese和fonts-ISO8859-2等,并手动解决了一系列依赖冲突。在安装过程中,遇到了glibc版本冲突,通过降级安装解决了问题。最后,通过设置环境变量LANG和修改/etc/sysconfig/i18n文件,成功实现了Linux系统显示中文。此外,还提供了通过yum groupinstall 'Chinese Support'的简便方法来安装中文支持。
摘要由CSDN通过智能技术生成

上网搜索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

可能要使用的软件

  1. 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

    这两个是最主要的。

  2. 直接安装这两个软件

  3. rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm

    rpm -ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm

  4. 但如果你之前没有安装xwindow,可能在安装第一个软件时就会出错,如下图。

  5. centos/redhat中文支持安装
  6. 4

    我们再安装错误中出现的软件,又会出现报错。如图。

    centos/redhat中文支持安装
  7. 5

    这时,需要安装更多的依赖软件。我们依次安装

    rpm -ivh ./libFS-1.0.0-3.1.i386.rpm

    rpm -ivh ./ttmkfdir-3.0.9-23.el5.i386.rpm

    centos/redhat中文支持安装
    centos/redhat中文支持安装

  8. 6

    然后将下面两个软件一起安装,不然会出现循环依赖。

    rpm -ivh ./chkfontpath-1.10.1-1.1.i386.rpm  ./xorg-x11-xfs-1.0.2-4.i386.rpm 

    centos/redhat中文支持安装

  9. 7

    然后再依次安装第二步中的两个软件。

    rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm

    rpm -ivh fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm

  10. 8

    安装完成之后,重启系统。在登录时可以从最下面,选择桌面系统中显示中文。

    centos/redhat中文支持安装
    centos/redhat中文支持安装








  11. 9

    如果要在命令行终端中显示中文、在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"

    centos/redhat中文支持安装


  12. 10

    效果如下

    centos/redhat中文支持安装
  13. 11

    其实还有第二种简单的方法

    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


冲突问题的搜索:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值