017. perl: warning: Setting locale failed. 问题(已解决) - cwy007/tips-and-skills GitHub Wiki

You need to configure locale appropriately in /etc/default/locale, logout, login, and then run the regular commands

root@host:~# echo -e 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' > /etc/default/locale
root@host:~# exit
local-user@local:~$ ssh root@host
root@host:~# locale-gen en_US.UTF-8
root@host:~# dpkg-reconfigure locales

link: https://stackoverflow.com/questions/2499794/how-to-fix-a-locale-setting-warning-from-perl