Vagrant Repair “Setting locale failed” message on ubuntu/trusty32 #116


In this tutorial you will learn how to repair “Setting locale failed” message on a ubuntu/trusty32 Vagrant box. I will use 3 approaches in order to fix the problem:

1. Edit /etc/ssh/sshd_config and comment:
AcceptEnv LANG LC_*

2. Compile a list of locale definition files using
sudo locale-gen ro_RO.UTF-8

3. Creating set-locale.sh bash script:
LANG=en_US.UTF-8
LANGUAGE=
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=
and run it with:
source set-locale.sh

Code used during this tutorial:

Useful links:
http://www.liviubalan.com/fix-ssh-locale-environment-problems-on-ubuntu-server
http://askubuntu.com/questions/53177/bash-script-to-set-environment-variables-not-working
http://www.liviubalan.com/ubuntu-server-locales