SSH – warning setlocale: LCC_ALL

If you are getting an error like this when you try to login trough ssh

bash: warning: setlocale: LC_ALL: cannot change locale (en_DK.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (en_DK.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (en_DK.UTF-8)

Then it can be the fixed by enable the locale on the remote system.

1. edit the file locale.gen and uncommend the line with the locale you are getting in your error message, in my example it is en_DK.UTF-8

sudo nano /etc/locale.gen

2. generate the new extra locale

sudo locale-gen

Leave a Reply

Your email address will not be published. Required fields are marked *

4 + 4 =