xclock报错“Warning: Missing charsets in String to FontSet conversion”
欢迎来到之路教程(on itroad-com)

解决方案

发生这种情况是由于区域设置环境变量 LC_ALL 的设置不正确。
在大多数情况下,如果我们使用以下命令检查用户语言环境变量,我们会发现变量 LC_ALL 为空。

# locale | grep LC_ALL
LC_ALL=

解决方法:

  1. 使用以下命令设置 LC_ALL=C 变量
# export LC_ALL=C
  1. 要为特定用户永久更改此更改,请在 .bash_profile 文件中添加所需条目。
# vi /home/[username]/.bash_profile
LC_ALL=C
export LC_ALL

例如,要将其添加到用户“testuser”的个人资料中:

# vi /home/testuser/.bash_profile
LC_ALL=C
export LC_ALL
  1. 验证设置:
# echo $LC_ALL
C

问题

执行 xclock 命令触发错误 'Missing charsets in String to FontSet conversion' 。

# xclock
Warning: Missing charsets in String to FontSet conversion
Warning: Unable to load any usable fontset

警告:String 到 FontSet 转换中缺少字符集
警告:无法加载任何可用的字体集
日期:2020-09-17 00:14:06 来源:oir作者:oir