• 如何解决perl:警告:设置语言环境失败

    今天,在我的ubuntu服务器上,我执行了以下命令来重新配置MariaDB服务器。 sudo dpkg-reconfigure mariadb-server-10.0 屏幕上出现了一条警告。 perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_HK:en", LC_ALL = (unset), LC_PAPER = "zh_CN.UTF-8", LC_ADDRESS = "zh_CN.UTF-8", LC_MONETARY = "zh_CN.UTF-8", LC_NUMERIC = "zh_CN.UTF-8", LC_TELEPHONE = "zh_CN.UTF-8", LC_IDENTIFICATION = "zh_CN.UTF-8", LC_MEASUREMENT = "zh_CN.UTF-8", LC_TIME = "zh_CN.UTF-8", LC_NAME = "zh_CN.UTF-8", LANG = "en_HK.UTF-8" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("en_HK.UTF-8"). locale: Cannot set LC_ALL to default locale: No such file or directory 它说设置语言环境失败了。 解决方案 首先列出用户当前的语言环境设置。 $ locale LANG=en_HK.UTF-8 LANGUAGE=en_HK:en LC_CTYPE="en_HK.UTF-8" LC_NUMERIC=zh_CN.UTF-8 LC_TIME=zh_CN.UTF-8 LC_COLLATE="en_HK.UTF-8" LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES="en_HK.UTF-8" LC_PAPER=zh_CN.UTF-8 LC_NAME=zh_CN.UTF-8 LC_ADDRESS=zh_CN.UTF-8 LC_TELEPHONE=zh_CN.UTF-8 LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=zh_CN.UTF-8 LC_ALL= 然后逐个生成这些区域设置。 $ sudo locale-gen "en_HK.UTF-8" Generating locales... en_HK.UTF-8... up-to-date Generation complete. $ sudo locale-gen "zh_CN.UTF-8" Generating locales... zh_CN.UTF-8... done Generation complete. 最后,重新配置区域设置。 $ sudo dpkg-reconfigure locales Generating locales... en_HK.UTF-8... done en_US.UTF-8... done zh_CN.UTF-8... up-to-date Generation complete. 现在区域设置问题消失了。

    2022.03.24 浏览:41