Skip to content

Instantly share code, notes, and snippets.

@nicks9188
Created May 6, 2019 13:51
Show Gist options
  • Select an option

  • Save nicks9188/a19f39d62780055a68c22b89a9799c25 to your computer and use it in GitHub Desktop.

Select an option

Save nicks9188/a19f39d62780055a68c22b89a9799c25 to your computer and use it in GitHub Desktop.
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
  1. vi /etc/environment

add these lines...

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Alternatively,

  1. Create locale file manually: localedef -i en_US -f UTF-8 en_US.UTF-8

Explained here

@chiro-hiro
Copy link
Copy Markdown

chiro-hiro commented Oct 7, 2025

If you got LC_CTYPE error, try adding this.

LC_CTYPE="en_US.UTF-8"

@kiprotichgidii
Copy link
Copy Markdown

kiprotichgidii commented Dec 22, 2025

Just place this in your /etc/environment file:

LANG="en_US.utf-8"
LC_ALL="en_US.utf-8"
LC_CTYPE="en_US.UTF-8"

Then run:

sudo localedef -i en_US -f UTF-8 en_US.UTF-8

@mofelee
Copy link
Copy Markdown

mofelee commented Mar 27, 2026

Just place this in your /etc/environment file:

LANG="en_US.utf-8"
LC_ALL="en_US.utf-8"
LC_CTYPE="en_US.UTF-8"

Then run:

sudo localedef -i en_US -f UTF-8 en_US.UTF-8

It works!!!

@zulik
Copy link
Copy Markdown

zulik commented Apr 9, 2026

worked on Deb13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment