When running apt-get I receive error locale: Cannot set LC_CTYPE to default locale: No such file or directory. What can I do to fix this error?

I am connecting from a box running Mac OS X.

link|improve this question
I re-wrote that a bit, to make your question actually have a question. – Zoredache Nov 9 '11 at 23:05
feedback

2 Answers

The resolution is simple if you're running Mac OS X while seeing this error through ssh:

sudo nano /etc/ssh_config Comment out the following line: "SendEnv LANG LC_*"

link|improve this answer
Are you connecting from the OSX box? Seems like it might be better to actually generate the locale you want. Personally I think I would go with the option to fix it on the server, instead of the client side. – Zoredache Nov 9 '11 at 23:00
feedback

Run dpkg-reconfigure locales on your Ubuntu, make sure at least one of the selection is selected. If you are not sure what to pick I suggest en_US.UTF-8.

If you are connecting via SSH from a system, then you will want to make sure you have generated the locales used by the client systems that will be connecting. You can select as many to locales to generate as you want/need.

As you mentioned in your answer, you can certainly choose to prevent SSH for either sending or accepting the LC* variables.

From an ssh client disable this.

ssh_config:    SendEnv LANG LC_*

On the SSH server you can block accepting the variables by removing this.

sshd_config:AcceptEnv LANG LC_*
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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