BadValue无效或未设置用户区域设置.请确保正确设置LANG和/或LC_ *环境变量 [英] BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly

查看:140
本文介绍了BadValue无效或未设置用户区域设置.请确保正确设置LANG和/或LC_ *环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行mongo时,我得到警告:

全局初始化失败:BadValue无效或未设置用户区域设置.请确保正确设置LANG和/或LC_ *环境变量.

解决方案

生成语言环境

缺少语言环境是通过locale-gen生成的:

locale-gen en_US.UTF-8

或者,可以使用localedef [1]手动创建区域设置文件

localedef -i en_US -f UTF-8 en_US.UTF-8

设置区域设置

可以如下设置区域设置(在示例中为en_US.UTF-8):

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

dpkg-reconfigure locales命令将在Debian下打开一个对话框,用于选择所需的语言环境.该对话框不会出现在Ubuntu下. 在Ubuntu中配置语言环境文章显示了如何查找有关Ubuntu的信息. >

When I run mongo, I get the warning:

Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.

解决方案

Generating locales

Missing locales are generated with locale-gen:

locale-gen en_US.UTF-8

Alternatively a locale file can be created manually with localedef:[1]

localedef -i en_US -f UTF-8 en_US.UTF-8

Setting Locale Settings

The locale settings can be set (to en_US.UTF-8 in the example) as follows:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

The dpkg-reconfigure locales command will open a dialog under Debian for selecting the desired locale. This dialog will not appear under Ubuntu. The Configure Locales in Ubuntu article shows how to find the information regarding Ubuntu.

这篇关于BadValue无效或未设置用户区域设置.请确保正确设置LANG和/或LC_ *环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆