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.

This question already has an answer here:

I am facing a problem as asked in this question, I have tried the proposed solution but facing the same issue

When I run 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=en_US.UTF-8
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=en_US.UTF-8

When I run

sudo locale-gen en_US.UTF-8

I get this error

sudo: unable to resolve host ubuntu
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Generating locales...
en_US.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: 
LC_ALL: cannot change locale (en_US.UTF-8)
/usr/sbin/locale-gen: line 243: 
8925 Killed localedef $no_archive -i $input -c -f $charset $locale_alias
$locale failed
Generation complete.

I am running Ubuntu Cloud Image on OpenStack cloud

share|improve this question

marked as duplicate by Eric Carvalho, David Foerster, bodhi.zazen, mikewhatever, Parto Mar 30 at 15:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
try to run localedef en_US.UTF-8 -i en_US -fUTF-8 –  Dmitry Ginzburg Apr 24 '14 at 7:53

2 Answers 2

I managed to solve the problem. It was because the RAM memory I used to boot the image was not enough.

I used 128 and did not work!

Now I used 512 RAM for my instance and it is working.

share|improve this answer

The problem is due to this bug. The cloud images only support "en_US.UTF-8" so you have to make sure that the host server (the install of Ubuntu Server which you use to SSH into the cloud install) is configured to use "en_US.UTF-8"

To do this generate the "en_US.UTF-8" on the Ubuntu server install:

$ sudo locale-gen en_US.UTF-8
Generating locales...
  en_US.UTF-8... done
Generation complete.

$ sudo dpkg-reconfigure locales
Generating locales...
  en_US.UTF-8... done
Generation complete.

Use the newly generated locale on the Ubuntu Server install by editing /etc/default/locale to contain only this line:

LANG=en_US.UTF-8

Reboot and then access the cloud install.

Edit:

People with a similar problem have had good luck editing (or creating) /etc/environment to contain:

LANG=en_US.UTF-8

... as well.

share|improve this answer
    
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 –  Umair Ayub Apr 24 '14 at 9:00
    
Worked perfectly for me :) Thank you ! –  ZedTuX Aug 20 '14 at 12:28
    
Also to fix this issue i had to add to /etc/default/locale the line LC_ALL=en_US.UTF-8 –  shacharsol May 31 at 22:21

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