Locales When Using SSH On A Remote Server
When SSHing to a remote server and compiling Python there (don’t ask), i stumbled upon the issue that gcc and other tools complained about a missing locale:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
As not even a sudo dpkg-reconfigure locales solved the issue, as I thought that I only had the „en_US.UTF-8” locale on the server.
But apparently, you also have to provide any locales you use locally (on the Laptop/PC you are SSHing from) on the server in order to fix the issue.
And lo and behold, once I added „de_AT.UTF-8” via sudo dpkg-reconfigure locales everything started working.
Which got me thinking, because that can’t be the solution to this issue, to add more and more or even all locales to all servers I have to touch.
So after a little digging, I found the solution, which I now official add to all my checklist for laptops/pcs I work on:Modify /etc/ssh/ssh_config by commenting/disabling the following line:
* ... # SendEnv LANG LC_*
Unfortunately, there is no „UnSendEnv” command.