![无法通过 Meld 解决区域设置问题](https://linux22.com/image/974004/%E6%97%A0%E6%B3%95%E9%80%9A%E8%BF%87%20Meld%20%E8%A7%A3%E5%86%B3%E5%8C%BA%E5%9F%9F%E8%AE%BE%E7%BD%AE%E9%97%AE%E9%A2%98.png)
每当我尝试运行编程工具时,meld
都会出现以下错误:
Traceback (most recent call last):
File "/usr/bin/meld", line 75, in <module>
locale.setlocale(locale.LC_ALL,'')
File "/usr/lib/python2.7/locale.py", line 540, in setlocale
return _setlocale(category, locale)
据我所知,我的语言环境设置已关闭,事实上,当我运行时,locale -a
我得到了:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.UTF-8
POSIX
同样,当我运行普通旧版本时,locale
我得到:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
问题是,当我尝试用以下方法修复该问题时sudo apt-get install language-pack-en-base
:
The following packages have unmet dependencies:
language-pack-en-base : Depends: locales (>= 2.3.6) but it is not going to be installed
当我尝试时,sudo apt-get install locales
我得到:
The following packages have unmet dependencies:
libc6 : Breaks: locales (< 2.18) but 2.13+git20110622-2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
如果我在 Synaptic 中尝试同样的事情,我发现安装locales
似乎会卸载系统中的每个软件包(包括 apt)!
我认为可能是我的来源搞砸了,所以我删除了除核心“old-releases.ubuntu.com”之外的所有内容,重新加载并重试,但这没有帮助。
因此,有人可以帮我解释一下如何才能做到:
A) 修复meld
而不弄乱所有这些区域设置内容?
或者
B)language-pack-en-base
无需取出其余的包裹就可以安装?
答案1
您的问题是 LANG 环境变量设置为 en_US.UTF-8,但尚未生成具有该名称的区域设置。通过运行以下命令修复此问题:
sudo locale-gen en_US.UTF-8
答案2
我已经使用我的语言集定义解决了此导出问题LC_ALL
。对于美国英语 UTF-8,请执行以下操作:
$ export LC_ALL="en_US.UTF-8"