命令未找到的“不支持的语言环境设置”错误

Ben*_*sel 52 language locale python3

我最近通过保留 Linux Mint 13 发行版中的主文件夹来安装 Ubuntu 12.10。系统安装得很好,但一开始一切都是中文的(甚至是终端中的文字)。我设法通过编辑一些文件来解决这个问题,但是只要在终端中找不到命令,我仍然会收到错误消息。这里是:

Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.2.3 final 0
Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:    12.10
Codename:   quantal
Exception information:

unsupported locale setting
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
callback()
  File "/usr/lib/command-not-found", line 69, in main
enable_i18n()
  File "/usr/lib/command-not-found", line 40, in enable_i18n
locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.2/locale.py", line 541, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
Run Code Online (Sandbox Code Playgroud)

我怎样才能摆脱这个错误。它说这是一个语言环境错误,所以我想这可能与最初的语言问题有关,但我不是 linux 方面的专家。你有什么意见?

Mar*_*ijn 90

我遇到了同样的问题,但在ubuntuforums找到了以下解决方案:

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
sudo dpkg-reconfigure locales
Run Code Online (Sandbox Code Playgroud)

  • 也为我工作,非常感谢! (2认同)
  • 我可以确认这是 13.10 (x64) 的工作解决方案 (2认同)

Ben*_*sel 15

我看了看,/etc/default/locale有些语言选项是中文的。我删除了这些并添加了以下内容,现在一切都很好:

LC_ALL="en_US.UTF-8"
Run Code Online (Sandbox Code Playgroud)

  • 不需要删除帖子。 (3认同)