debianでperlがはくlocale警告の修復完了

どこでどうなったか、Debianでlocaleのエラーが発生し始めましたが、無事解決しました。

 

[code lang="shell"]

$ sudo aptitude upgrade

No packages will be installed, upgraded, or removed.

0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Need to get 0 B of archives. After unpacking 0 B will be used.

Traceback (most recent call last):

File "/usr/bin/apt-listchanges", line 33, in <module>

from ALChacks import *

File "/usr/share/apt-listchanges/ALChacks.py", line 32, in <module>

sys.stderr.write(_("Can't set locale; make sure $LC_* and $LANG are correct!\n"))

NameError: name '_' is not defined

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = "en",

LC_ALL = "en_US",

LC_CTYPE = "UTF-8",

LC_MESSAGES = "C",

LANG = "C"

are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

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

[/code]

 

これを解決するには、

 

[code lang="shell"]

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

[/code]

 

で解決です。