Linux Tutorials

Perl: warning: Setting locale failed in Debian and Ubuntu

I am attempting to put in package deal and doing another work. However, getting the error that learn as “perl: warning: Setting locale failed. perl: warning: Please test that your locale settings:” How do I repair this drawback on my Debian Linux server?

The warning message displayed when Perl based mostly purposes known as. For instance, apt/apt-get internally use Perl to do administration of packages in Debian or Ubuntu Linux.

Adblock detected 😱

My web site is made attainable by displaying on-line commercials to my guests. I get it! Adverts are annoying however they assist hold this web site working. It’s exhausting to maintain the positioning working and producing new content material when so many individuals block adverts. Please contemplate donating cash to the nixCraft by way of PayPal/Bitcoin, or turn out to be a supporter utilizing Patreon.

Perl: warning: Setting locale failed in Debian and Ubuntu

Here’s a pattern session created by apt-get command / apt command:
$ sudo apt-get set up iperf
Pattern outputs:

Studying package deal lists… Performed
Constructing dependency tree
Studying state data… Performed
The next NEW packages shall be put in:
iperf
zero upgraded, 1 newly put in, zero to take away and zero not upgraded.
Must get zero B/57.2 kB of archives.
After this operation, 164 kB of extra disk area shall be used.
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).
locale: Can’t set LC_ALL to default locale: No such file or listing
Choosing beforehand unselected package deal iperf.
(Studying database … 40493 recordsdata and directories at present put in.)
Making ready to unpack …/iperf_2.zero.9+dfsg1-1_amd64.deb …
Unpacking iperf (2.zero.9+dfsg1-1)
Establishing iperf (2.zero.9+dfsg1-1)
Processing triggers for man-db (2.7.6.1-2)
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).
locale: Can’t set LC_ALL to default locale: No such file or listing
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).

Studying package deal lists… Performed
Constructing dependency tree
Studying state data… Performed
The next NEW packages shall be put in:
iperf
zero upgraded, 1 newly put in, zero to take away and zero not upgraded.
Must get zero B/57.2 kB of archives.
After this operation, 164 kB of extra disk area shall be used.
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).
locale: Can’t set LC_ALL to default locale: No such file or listing
Choosing beforehand unselected package deal iperf.
(Studying database … 40493 recordsdata and directories at present put in.)
Making ready to unpack …/iperf_2.zero.9+dfsg1-1_amd64.deb …
Unpacking iperf (2.zero.9+dfsg1-1) …
Establishing iperf (2.zero.9+dfsg1-1) …
Processing triggers for man-db (2.7.6.1-2) …
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).
locale: Can’t set LC_ALL to default locale: No such file or listing
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = “en_IN.UTF-Eight”,
LC_MONETARY = “en_IN.UTF-Eight”,
LC_MEASUREMENT = “en_IN.UTF-Eight”,
LC_NUMERIC = “en_IN.UTF-Eight”,
LC_PAPER = “en_IN.UTF-Eight”,
LANG = “en_US.UTF-Eight”
are supported and put in in your system.
perl: warning: Falling again to a fallback locale (“en_US.UTF-Eight”).

Understanding locales in Ubuntu and Debian Linux

Locales are a framework to modify between a number of languages and permit customers to make use of their language, nation, characters, collation order, date and time, and so on. Be sure to set locales producing UTF-Eight locales. Different character units could be set for backwards compatibility with older methods and software program.

Find out how to repair Perl: warning: Setting locale failed in Debian and Ubuntu

Kind the next instructions to repair it. I’m utilizing en_US.UTF-Eight. You’ll be able to see listing of all localisation in /and so on/locale.gen utilizing the cat command:
cat /and so on/locale.gen
OR
extra /and so on/locale.gen
Another choice is to make use of grep command to seek for particular locales.

## For instance, seek for English India ##
grep en_IN /and so on/locale.gen
 
## Seek for English US ##
grep en_US /and so on/locale.gen
 
## Seek for Japanese ##
grep ja_JP /and so on/locale.gen

## For instance, seek for English India ##
grep en_IN /and so on/locale.gen ## Seek for English US ##
grep en_US /and so on/locale.gen ## Seek for Japanese ##
grep ja_JP /and so on/locale.gen

Perl: warning: Setting locale failed in Debian

Understanding “ja_JP.UTF-Eight” or “en_US.UTF-Eight”

The ja_JP.UTF-Eight outlined character encoding for Japanese language customers as follows:

Locale is ja_JPEncoding is UTF-Eight

Equally, en_US.UTF-Eight is for English person from USA:

So locale is about to en_USAnd encoding is about to UTF-Eight

To view present details about the present locale, or all locales, in your display screen run locale command:
locale
Pattern outputs:

LANG=en_IN.UTF-Eight
LC_CTYPE=“en_IN.UTF-Eight”
LC_NUMERIC=en_IN.UTF-Eight
LC_TIME=en_IN.UTF-Eight
LC_COLLATE=“en_IN.UTF-Eight”
LC_MONETARY=en_IN.UTF-Eight
LC_MESSAGES=“en_IN.UTF-Eight”
LC_PAPER=en_IN.UTF-Eight
LC_NAME=“en_IN.UTF-Eight”
LC_ADDRESS=“en_IN.UTF-Eight”
LC_TELEPHONE=“en_IN.UTF-Eight”
LC_MEASUREMENT=en_IN.UTF-Eight
LC_IDENTIFICATION=“en_IN.UTF-Eight”
LC_ALL=

LANG=en_IN.UTF-Eight
LC_CTYPE=”en_IN.UTF-Eight”
LC_NUMERIC=en_IN.UTF-Eight
LC_TIME=en_IN.UTF-Eight
LC_COLLATE=”en_IN.UTF-Eight”
LC_MONETARY=en_IN.UTF-Eight
LC_MESSAGES=”en_IN.UTF-Eight”
LC_PAPER=en_IN.UTF-Eight
LC_NAME=”en_IN.UTF-Eight”
LC_ADDRESS=”en_IN.UTF-Eight”
LC_TELEPHONE=”en_IN.UTF-Eight”
LC_MEASUREMENT=en_IN.UTF-Eight
LC_IDENTIFICATION=”en_IN.UTF-Eight”
LC_ALL=

Find out how to generate locales on Debian or Ubuntu Linux

Run the locale-gen command to generate locales from /and so on/locale.gen for English USA person:
$ sudo locale-gen
OR
$ sudo locale-gen en_US.UTF-Eight
One can run the next too:
$ sudo localedef -i en_US -f UTF-Eight en_US.UTF-Eight

Find out how to repair a locale setting warning from Perl in Debian and Ubuntu Linux

Personally, I fastened it as follows utilizing mixture of the export command, locale-gen command and [nixmd name=”dpkg-reconfigure”]:
$ sudo export LANGUAGE=en_US.UTF-Eight
$ sudo export LANG=en_US.UTF-Eight
$ sudo export LC_ALL=en_US.UTF-Eight
$ sudo locale-gen en_US.UTF-Eight
Pattern outputs:

Producing locales (this would possibly take some time)
en_US.UTF-Eight… finished
Technology full.

Producing locales (this would possibly take some time)…
en_US.UTF-Eight… finished
Technology full.

Open the dialog field:
$ sudo dpkg-reconfigure locales
Setting Locale Settings on Ubuntu Linux
Subsequent, set defaults to repair a locale setting warning from Perl:
How to fix a locale setting warning from Perl
Now you arrange appropriate locales and check with apt/apt-get:
$ sudo apt set up foo

Conclusion

This web page confirmed you tips on how to use the dpkg-reconfigure and different instructions to arrange the specified locale. Establishing appropriate locales is important. Therefore, you bumped into the issue, and we configured the locales in Debian or Ubuntu to repair it. For extra data see this and this web page about locale encodings.

Posted by: Vivek Gite

The creator is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a coach for the Linux working system/Unix shell scripting. Get the newest tutorials on SysAdmin, Linux/Unix and open supply matters by way of RSS/XML feed or weekly electronic mail publication.

Source link

Related Articles

Back to top button