How Fix perl: warning: Setting locale failed. – Fixed in CentOS 7



[root@lab program]#

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),

LC_CTYPE = "UTF-8",

LANG = "en_US.UTF-8"

    are supported and installed on your system.

perl: warning: Falling back to a fallback locale ("en_US.UTF-8").

[root@lab program]#

It was on DO server which I used SSH terminal to connect from macOS. If you are encountering this error, here is how you can fix.




Solution

Export the following locale on your terminal and run the program.


export LC_CTYPE=en_US.UTF-8

export LC_ALL=en_US.UTF-8

It ran smoothly to me and hope it helps you too.


This is fine if you just need to do one time. However, if you need to run it periodically then you may want to set this in profile so it loads during logon.


Go to the user’s home directory

Modify .bash_profile (assuming you are using bash) using vi

Add the following and save the file

export LC_CTYPE=en_US.UTF-8

export LC_ALL=en_US.UTF-8

That’s all!


Now, I can run Perl 😊


Sumber : https://geekflare.com/perl-warning-setting-locale-failed/



How Fix perl: warning: Setting locale failed. – Fixed in CentOS 7  How Fix perl: warning: Setting locale failed. – Fixed in CentOS 7 Reviewed by ilham.sp on December 08, 2020 Rating: 5

No comments:

Notice

This site uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies.Learn More

Powered by Blogger.