“Perl warning Setting locale failed” Error and Solution In Linux

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/perl-warning-setting-locale-failed-error-and-solution-in-linux/
PINTEREST
PINTEREST
INSTAGRAM

All operating systems uses some locale settings to properly interpret language related data. In Linux this settings are called as locale and used even without GUI or desktop environment. They are generally configured during installation of the operating system but also changed after installation. “Perl warning Setting locale failed” is mostly occurring error after installation. Which is caused by locale miss configuration. In this tutorial we will look how to solve this error.

“perl: warning: Setting locale failed.” Error

The error will be look like below.

"perl: warning: Setting locale failed." Error
“perl: warning: Setting locale failed.” Error

Regenerate Locales

Debian, Ubuntu, Mint, Kali

The most practical and easy solution is regenerating locales. We will use locale-gen and specify the locate type we want to set and regenerate. We need sudo privileges for this.

Regenerate Locales 
Regenerate Locales

Another way to specify locales explicitly is using export with bash variables and than call dpkg-reconfigure on locales.

Setting Locales Explicitly
Setting Locales Explicitly

Fedora, CentOS, RHEL

In CentOS way we can use localectl  command and set-locale option for this.

Setting Locales Explicitly

We can also set locales explicitly. We will  use localdef command and specify the locales we want to use.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/perl-warning-setting-locale-failed-error-and-solution-in-linux/
PINTEREST
PINTEREST
INSTAGRAM
LEARN MORE  What Is ASCII Code and Table?