manpath: can‘t set the locale; make sure $LC_* and $LANG are correct
这个错误信息表明在通过 SSH 登录远程服务器时,系统无法正确设置本地化(locale)环境。这通常是因为服务器缺少所需的 locale 配置或环境变量设置问题。以下是详细解决方案:
1. 检查服务器支持的 locale
登录服务器后执行:
bash
locale -a
查看是否包含你需要的 locale(如 en_US.utf8
)。如果列表为空或不包含所需项,需生成 locale。
2. 生成缺失的 locale
Ubuntu/Debian 系统:
bash
sudo apt update sudo apt install locales -y # 确保 locales 包已安装 sudo dpkg-reconfigure locales # 在列表中选择需要的 locale(如 en_US.UTF-8),按空格选中,回车确认
CentOS/RHEL 系统:
bash
sudo yum install glibc-common -y # 确保包已安装 # 编辑配置文件 sudo vim /etc/locale.conf # 添加以下内容: LANG="en_US.UTF-8" LC_ALL=&