Login to Members Area

Choose the service you want to log in
     
24x7x365 Presence
1-888-289-2246
Live Chat

Hosting Blog

 

Failed to set locale, defaulting to C

This error "Failed to set locale, defaulting to C" is generally occur on ubuntu OS when there is no locale setup permanently in the environment which you work. It most commonly comes when you do login to your ubuntu machine via ssh or while start/stop a service on it. To fix this problem follow are some ways which suited on the distribution basis using below steps :-

1)

sudo locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales

dpkg-reconfigure reconfigures packages after they have already been installed.

2) However, in some ubuntu distribution it doesn't resolve the issue with above and there need to do the following way :-

export LANG=en_US

or

Put the file below lines in /etc/environment:

LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8

or

Add the below line in .bashrc file :-

export LC_ALL="en_US.UTF-8"


Note: Make sure that on your machine the language pack has been installed otherwise the above entries won't work. So to install the language pack just run the below command :-

apt-get install language-pack-en-base  

These above are some ways as per the distribution to solve this  locale setting error.

Sachin Wednesday 09 July 2014 - 11:52 pm | | Default
Used tags: , , ,

No comments

(optional field)
(optional field)

Comment moderation is enabled on this site. This means that your comment will not be visible until it has been approved by an editor.

Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.