centos7安裝中文字型
centos7買來以後一般都是空白的,很多東西需要安裝不廢話,直接來安裝:
1、先把windows下的字型檔拷貝到usr/share/fonts/win檔案夾下面,然後用命令:
修改字型全新:
[csharp]view plaincopy
- 修改字型檔的許可權,使root使用者以外的使用者也可以使用chmod755*
[root@iZ250234rf8ZTrueType]#mkfontscale[root@iZ250234rf8ZTrueType]#mkfontdir[root@iZ250234rf8ZTrueType]#fc-cache-fv
如果找不到命令mkfontscale則要安裝,yum install mkfontscale (fc命令也是一樣的執行:yum install fontconfig)
如果安裝時出現Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"Trying other mirror.,出現類似的錯誤,則很有可能是dns解析的問題:可以在vi /etc/resolv.conf配置兩個dns:
nameserver 8.8.8.8##google網域名稱 伺服器nameserver 8.8.4.4 ##Google網域名稱伺服器
然後service network restart 重啟
繼續安裝命令安裝完:查看字型fc-list查看所有字型
重啟機器,如果不生效最好也重啟下應用reboot;
如果還不行再執行以下內容:
[csharp]view plaincopy
- #yumgroupinstallchinese-support
- console終端也必須設定為utf8編碼
- 1、console終端亂碼
- 在/etc/profile檔案的最後一行添加如下內容:
- exportLC_ALL="zh_CN.utf8"