未配置之前会有类似这样的提示:man: can't set the locale; make sure $LC_ and $LANG are correct*。

  1. 查看当前本地化配置:
# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
  1. 修改 /etc/locale.gen,去掉 #en_US.UTF-8 UTF-8 前面的 #
  2. 执行 locale-gen
  3. 查看当前系统可用的本地化设置:eselect locale list
  4. 设置本地化:eselect locale set 3
  5. 执行更新:env-update && source /etc/profile
  6. 最后的环境:
# eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   en_US.utf8 *
  [3]   POSIX
  [ ]   (free form)

参考连接:https://wiki.gentoo.org/wiki/Localization/Guide