操作系统您现在的位置是:首页 > 博客日志 > 操作系统

Centos7.x离线安装mkfontscale和fontconfig(也可解决截图乱码问题)

<a href='mailto:'>微wx笑</a>的头像微wx笑 2022-12-17操作系统120 0 0关键字: Centos  字体  

#因为是离线环境,所以下面的命令用不了,#如果你可以连网,那直接执行以下命令直接跳到 “安装字体” 那一步yum install -y mkfontscaleyum install -y fontconfig于是就兴高采

1
2
3
#因为是离线环境,所以下面的命令用不了,#如果你可以连网,那直接执行以下命令直接跳到 “安装字体” 那一步
yum install -y mkfontscale
yum install -y fontconfig

于是就兴高采烈百度寻找答案,结果CSDN的好大哥们放的依赖包要钱~~~~
付费下载是不可能的了~,自己动手下呗!(获取依赖包方法在文末尾!)
链接:https://pan.baidu.com/s/14qHu_fFvzSWij70V2gONFw 提取码:6d87
亲测可用~~~6pg无知

1
#执行安装命令rpm -ivh ./*.rpm --nodeps --force  #我的是当前目录,所以是./

接下来就是安装字体了6pg无知

1
<code style="margin: 0px; padding: 1em; font-family: "Courier New", sans-serif; transition-duration: 0.2s; transition-property: color, opacity, border-color, padding-top, padding-bottom, margin-top, margin-bottom, height; background: rgb(245, 245, 245); color: rgb(68, 68, 68); display: block; font-size: 12px; border: 1px solid rgb(204, 204, 204); border-radius: 3px; overflow-x: auto; line-height: 1.5; white-space: pre-wrap;"><table><tbody style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;"><span style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; color: rgb(43, 145, 175);">#</span><span style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;">安装字体</span></td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;">mkdir -p /usr/share/fonts</td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;"><span style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; color: rgb(43, 145, 175);">#</span><span style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;">把要安装的字体上传到/usr/share/fonts路径下,之后再依次执行一下命令就大功告成了</span></td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;">cd /usr/share/fonts/</td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;"><br></td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;">mkfontscale</td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;"><br></td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;">mkfontdir</td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;"><br></td></tr><tr style="margin: 0px; padding: 0px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity;"><td style="margin: 0px; padding: 0px 14px; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial; user-select: none; text-align: center; vertical-align: top; color: rgb(191, 191, 191); white-space: nowrap;"><br></td><td style="margin: 0px; padding: initial; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding-top, padding-bottom, margin-top, margin-bottom, color, opacity; border-width: initial; border-style: none; border-color: initial; border-collapse: initial; min-width: initial;">fc-cache</td></tr></tbody></table></code>

我是怎么获取依赖包的呢???6pg无知

1
1、准备另一台能联网的Linux机器(要配置yum,建议配阿里的,网上很多教程,很简单!)2、安装获取依赖包的命令,然后新建一个文件来存放依赖包#安装获取依赖包的命令yum -y install yum-utils#新建一个文件来存放依赖包mkdir -p /root/font_rpm#执行获取相关依赖命令yumdownloader --resolve --destdir=/root/font_rpm mkfontscale fontconfig
---------是故无冥冥之志者----------
---------无昭昭之明----------
---------无惛惛之事者----------
---------无赫赫之功----------
本文来自博客园,作者:|是吴啊|,转载请注明原文链接:https://www.cnblogs.com/wuguofeng/p/15923241.html


6pg无知

本文为转载文章,版权归原作者所有,不代表本站立场和观点。

很赞哦! (5) 有话说 (0)

文章评论