perl: warning: Setting locale failed. – Fixed in CentOS 8

Are you getting a “native setting failed” warning when operating Perl on CentOS 8?

I attempted to run Nikto and received this error.

[root@lab program]# ./nikto.pl -h $IPADDRESS
perl: warning: Setting locale failed.
perl: warning: Please test that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and put in in your system.
perl: warning: Falling again to a fallback locale ("en_US.UTF-8").
[root@lab program]#

It was on the DO server the place I used the SSH terminal to attach from macOS. In case you encounter this error, here is easy methods to repair it.

Resolution

Export the next locale to your terminal and run this system.

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

It went easily for me and I hope it helps you too.

That is high quality for those who solely have to do it as soon as. Nonetheless, if you might want to run it periodically, you might wish to set it up in your profile in order that it hundreds throughout login.

  • Go to the person’s house listing
  • To course of .bash_profile (assuming you are utilizing bash). vi
  • Add the next and save the file
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

That is all!

Now I can run Perl 😊

Rate this post
Leave a Comment