Linux捣鼓记录:debian配置语言环境

1. 安装区域设置

sudo apt update  
sudo apt install locales

2. 配置语言环境

sudo dpkg-reconfigure locales

按空格多选,选中en_US.UTF-8和zh_CN.UTF-8

这里多选择了英文,可以避免有些软件比如steamcmd报警告:
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.

按Tab,光标跳到<确定>
按回车,选择zh_CN.UTF-8作为系统环境默认的区域设置。

3. 配置 .profile 或 .bashrc 确保你的 shell 启动时会加载正确的语言环境。

可以在 ~/.profile 或 ~/.bashrc 中添加以下行:

export LC_ALL=zh_CN.UTF-8
export LANG=zh_CN.UTF-8

4. 重启检查语言环境变量

echo $LC_ALL  
echo $LANG
posted @ 2024-07-27 15:19  lwlnice  阅读(8)  评论(0编辑  收藏  举报