Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
Created April 24, 2012 08:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlafeldt/2477731 to your computer and use it in GitHub Desktop.
Save mlafeldt/2477731 to your computer and use it in GitHub Desktop.
Vagrant locales
vagrant@lucid32:~$ locale
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_US
LC_CTYPE=UTF-8
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
vagrant@lucid32:~$ locale
LANG=en_US
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE=en_US.UTF-8
LC_MONETARY="en_US"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
@mlafeldt
Copy link
Author

Fix locales on OSX:

$ LC_CTYPE=en_US.UTF-8 vagrant ssh

@wbednarski
Copy link

or just put export LC_CTYPE=en_US.UTF-8 into your .bash_profile or so

@sebinsua
Copy link

sebinsua commented Jun 4, 2014

Just going to add a comment here to say that if you're having difficulty installing PostgreSQL on a vagrant box this might fix it.

I was getting errors like this during the installation of PostgreSQL and it was leaving the machine in a broken state:

Setting up ssl-cert (1.0.28ubuntu0.1) ...
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
Setting up postgresql-common (129ubuntu1) ...
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
Adding user postgres to group ssl-cert
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Setting up postgresql-9.1 (9.1.13-0ubuntu0.12.04) ...
Error: The locale requested by the environment is invalid.
Error: could not create default cluster. Please create it manually with

  pg_createcluster 9.1 main --start

or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/9.1/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.
Setting up postgresql (9.1+129ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

Also see: https://gist.github.com/jschoolcraft/1963369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment