由于命令未找到而导致“不支持的区域设置”错误

由于命令未找到而导致“不支持的区域设置”错误

我最近安装了 Ubuntu 12.10,保留了 Linux Mint 13 发行版的主文件夹。系统安装正常,但一开始所有内容都是中文(甚至终端中的文本也是如此)。我设法通过编辑一些文件解决了这个问题,但每当在终端中找不到命令时,我仍然会收到错误。如下所示:

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

我该如何摆脱这个错误。它说这是一个区域设置错误,所以我猜这可能与最初的语言问题有关,但我不是 Linux 方面的专家。你的看法是什么?

答案1

我遇到了同样的问题,但在以下位置找到了解决方案ubuntu论坛

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

答案2

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

LC_ALL="en_US.UTF-8"

相关内容