I was trying to run Nikto and got this error. 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. 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

That’s all! Now, I can run Perl 😊

perl  warning  Setting locale failed    Fixed in CentOS 8 - 60perl  warning  Setting locale failed    Fixed in CentOS 8 - 16perl  warning  Setting locale failed    Fixed in CentOS 8 - 8perl  warning  Setting locale failed    Fixed in CentOS 8 - 66perl  warning  Setting locale failed    Fixed in CentOS 8 - 63perl  warning  Setting locale failed    Fixed in CentOS 8 - 27perl  warning  Setting locale failed    Fixed in CentOS 8 - 88perl  warning  Setting locale failed    Fixed in CentOS 8 - 71perl  warning  Setting locale failed    Fixed in CentOS 8 - 41perl  warning  Setting locale failed    Fixed in CentOS 8 - 12perl  warning  Setting locale failed    Fixed in CentOS 8 - 87perl  warning  Setting locale failed    Fixed in CentOS 8 - 2perl  warning  Setting locale failed    Fixed in CentOS 8 - 70perl  warning  Setting locale failed    Fixed in CentOS 8 - 67perl  warning  Setting locale failed    Fixed in CentOS 8 - 77perl  warning  Setting locale failed    Fixed in CentOS 8 - 63perl  warning  Setting locale failed    Fixed in CentOS 8 - 34perl  warning  Setting locale failed    Fixed in CentOS 8 - 38perl  warning  Setting locale failed    Fixed in CentOS 8 - 70perl  warning  Setting locale failed    Fixed in CentOS 8 - 10perl  warning  Setting locale failed    Fixed in CentOS 8 - 16perl  warning  Setting locale failed    Fixed in CentOS 8 - 21perl  warning  Setting locale failed    Fixed in CentOS 8 - 69