Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just did a fresh install of ubuntu using debootstrap. When I do sudo aptitude upgrade, I get this error message:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en_US:en",
    LC_ALL = (unset),
    LANG = "en_US.ISO-8859-1"
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

Can someone please tell me how to resolve this issue? I see a lot of postings similar to this online but none of them seems to resolve the problem.

I am using Ubuntu 14.04 LTS. Thanks.


FYI:

$ locale -a
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.iso88591
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX

and

$ locale
LANG=en_US.ISO-8859-1
LANGUAGE=en_US:en
LC_CTYPE="en_US.ISO-8859-1"
LC_NUMERIC="en_US.ISO-8859-1"
LC_TIME="en_US.ISO-8859-1"
LC_COLLATE="en_US.ISO-8859-1"
LC_MONETARY="en_US.ISO-8859-1"
LC_MESSAGES="en_US.ISO-8859-1"
LC_PAPER="en_US.ISO-8859-1"
LC_NAME="en_US.ISO-8859-1"
LC_ADDRESS="en_US.ISO-8859-1"
LC_TELEPHONE="en_US.ISO-8859-1"
LC_MEASUREMENT="en_US.ISO-8859-1"
LC_IDENTIFICATION="en_US.ISO-8859-1"
LC_ALL=
share|improve this question
    
This was answered here already askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue Summary: define LC_ALL on /etc/default/locale –  h7r Aug 31 at 8:45

2 Answers 2

up vote 2 down vote accepted

The debootstrap doesn't create a locale. So we use something else as a locale. Use this command:

sudo locale-gen en_US.ISO-8859-1

I hope this helps!

share|improve this answer
    
Nope, aptitude is valid too. Your answer will not give any changes to the OP. –  Danatela May 9 at 4:54
1  
While that may solve the locale error, it gives you a system with latin1 encoding, which is not suitable on Ubuntu. –  Gunnar Hjalmarsson May 9 at 14:11
    
Also, in ~/.kde.env/setlocale.sh, you set export LANG=en_US.UTF-8 –  user1527227 May 13 at 16:41

An Ubuntu desktop should be set up with UTF-8 encoding. For some reason your system tries to set the latin1 locale en_US.ISO-8859-1. You should really change that.

Maybe the setting takes place in /etc/default/locale.

Whereever it happens, change it to

LANG=en_US.UTF-8

or else you will encounter various locale related surprises.

share|improve this answer
    
Are you sure that's the one to use? How do you know? –  user1527227 May 9 at 15:39
    
@user1527227: Well, almost. ;) Because AFAIK en_US.UTF-8 comes pre-generated on every Ubuntu desktop. But you can easily check it by running the locale -a command. It would be good if you edited the question and added the output of that command. –  Gunnar Hjalmarsson May 9 at 16:39
    
i added the info you requested. –  user1527227 May 9 at 16:52
    
@user1527227: Ok, and there we can see en_US.utf8 in the locale -a output. My advice to change from en_US.ISO-8859-1 to en_US.UTF-8 stands. –  Gunnar Hjalmarsson May 9 at 17:07
    
Thank you. Do you know how to exactly do that? I do not see /etc/default/locale. Can I just run sudo locale-gen en_US.utf8? –  user1527227 May 9 at 17:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.