Strange things with locale

Nicolai Antiferov
1 min readJan 5, 2021

--

Some time ago I faced weird problems with locale during ssh from macOS to different remote Linux hosts (mostly Debian based).

After some digging, found that for some reason, LC_CTYPEwas set to“UTF-8”, but locale wasLANG=en_US.UTF-8 . As a result, a lot of linux tools were complainig with messages like this:

  • locale: Cannot set LC_CTYPE to default locale: No such file or directory
  • apt-listchanges: Can’t set locale; make sure $LC_* and $LANG are correct!
  • perl: warning: Setting locale failed. Please check that your locale settings

And after some google’ing the reason was found: since some version macOS tries to “improve” your experience by setting locale on remote systems to the same as your local one. Which causes these consequences.

So the solution is to comment out this lineSendEnv LANG LC_* in /private/etc/ssh/ssh_config (macOS ≥ 10.13). For older OS it’s /private/etc/ssh_config . Don’t forget sudo when edit.

--

--

Nicolai Antiferov
Nicolai Antiferov

No responses yet