Warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

In vscode i was getting the error while launching the terminal:
warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

check the issue on github : https://gist.github.com/jampajeen/841d4eed4da3e6c758bf

run command : sudo nano /etc/environment
add the below two lines
save- ctrl+o
confirm save
exit nano with- ctrl+x
run command : source /etc/environment

You should be good to go. But i discovered that it needs to reboot. I have given my system specs below for your reference.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

This is definitely not the proper solution.
This proposed “solution” at an old Centos topic is a bad practice for Archlinux.
Setting LC_ALL is for troubleshooting only, while setting it permanently is advised against in Archwiki.
This should also be noticed clearly for future readers.

A proper solution is to find how to properly set locale env vars, and in case there is a bug in a package, it should be reported upstream for a fix.

I don’t use vscode, so I can’t check for more info. It could be either vscode, or the used terminal need proper configuration, or system and/or user locale should be properly configured. This issue is not uncommon, and I am sure there are similar topics that you might find with a forum search.

If you want some assistance, please, post output of these commands:

grep . /etc/locale.conf /etc/vconsole.conf
grep -v "^#" /etc/locale.gen
ls -l "$HOME"/.config | grep locale
inxi -SIMaz
1 Like