4

Whenever I log in to my Ubuntu 12.10 server via SSH, I see:

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
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

I've tried -

  • exporting the right locale
  • adding the EXPORT command to /etc/environment
  • dpkg-reconfigure locale
  • running locale and checking the en_GB and en_GB.UTF-8 locales are installed (which it is)
  • regenerating the locales with locale-gen en_GB.UTF-8

and various combinations of the above. Anyone know anything else I can try?

[edit] More info as requested by Gunnar Hjalmarsson

Output of the locale command:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE=UTF-8
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

Contents of /etc/default/locale

LANG="en_GB.UTF-8"
LANGUAGE="en_GB:en"
LC_ALL="en_GB.UTF-8"
1
  • Can you add to your question the output of the locale command and the contents of /etc/default/locale. Apr 12, 2014 at 12:54

1 Answer 1

3

The problem is most likely caused by the fact that LC_CTYPE is somehow, somewhere set to "UTF-8", which is not a valid locale name. So you need to figure out how it happens and delete that incorrect setting.

1
  • 1
    Thanks for pointing that out - I looked straight past it! I added LC_CTYPE="en_GB.UTF-8" to /etc/default/locale and that fixed it. Thanks!
    – hippyjim
    Apr 12, 2014 at 14:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .