使用 apt-get 安装软件时,总是出现下面的错误。

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:",
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

安装软件时,都会去执行 update-locale 命令,用来更新 locale。这个命令是 perl 脚本(可以用 whereis update-locale 查到)

root@ubuntu:/# whereis update-locale
update-locale: /usr/sbin/update-locale /usr/share/man/man8/update-locale..gz

使用指令测试 perl,并不是因为 update-locale 命令错了,而是因为 perl 的配置出了问题。

root@ubuntu:/# perl -e exit

perl 使用系统提供的默认 local 的 en_US.UTF-8,但这个值是 ssh 从客户端传递来的,系统其实不知道 en_US.UTF-8 该如何处理。

安装语言包即可,但是不知道语言包名称,此时可以通过官网来查询语言包名称

ubuntu 查询包名网站:https://packages.ubuntu.com/

点击搜索后就会出现匹配的包名,其实 language-pack-en 依赖于 language-pack-en-base,安装 language-pack-en 的同时会默认安装 language-pack-en-base

如果想确认的话可以点击 language-pack-en 下面的 xenial(16.04 LTS),里面可以看到其所有依赖包、推荐包、建议包等。

root@ubuntu:/# apt-get install language-pack-en

安装成功后再使用指令测试 perl,再不会报错。

参考网站:https://www.jianshu.com/p/7cb39acb2513

Linux perl: warning: Setting locale failed.perl: warning: Please check that your locale settings:的更多相关文章

  1. perl: warning: Setting locale failed.

    本篇文章由:http://xinpure.com/perl-warning-setting-locale-failed/ 将 mac 系统切换成英文后,使用 git 命令出现如下错误: perl: w ...

  2. 解决perl: warning: Setting locale failed.

    在Ubuntu Server 12.04上执行apt-get install命令时,报如下warning   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...

  3. perl: warning: Setting locale failed. 解决

    perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAG ...

  4. 解决:perl: warning: Please check that your locale settings

    问题: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LAN ...

  5. Please check that your locale settings问题

    问题描述: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: L ...

  6. 1- Mac和Linux远程连接服务器异常修复(WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)

    p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1) } span.s1 { font-variant-ligatures: no-c ...

  7. Linux系统非root用户安装perl模块

    非root权限安装perl 在使用Linux或是unix时,perl是一个非常有用的脚本的语言. 关于perl的模块安装,网上也有很多介绍,一方面可以通过不同套件自带的软件安装工具安装,一方面可以通过 ...

  8. Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 10 in

    Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 10 ...

  9. Installing perl and writing your first perl program in Ubuntu

    Installing perl and writing your first perl program in Ubuntu     Installing perl and writing your f ...

随机推荐

  1. Eclipse workspace被锁定

    重新打开Eclipse时,提示如下: Workspace Unavailable: Workspace in use or cannot be created, choose a different ...

  2. 安装xshell、xftp

    1.Xshell的软件的下载.安装 xshell是一个终端模拟软件,而且是远程近程都可以. 就是模拟服务器所在的linux,在xshell中可以输入命令, 就像在服务器的linux中输入命令一样.一般 ...

  3. 静态库 VS 动态库

    如何得到库 ①先写好一堆的.c文件(.c:我们所需要的各种工具函数) ②将这些.c编译为对应的.o ③将所有的这些.o打包为一个仓库文件(静态库或者动态库) 静态库:按照静态库的方式打包 动态库:按照 ...

  4. Python_字符串相关操作

    1.字符串切片操作: str1='hello word' startIndex=0 #开始索引位置 endIndex=5 #结束索引位置+1 step=2 #步长 print(str1[startIn ...

  5. Spring Cloud 之 服务网关

    在微服务架构体系中,使用API 服务网关后的系统架构图如下: API服务网关的主要作用如下: 服务访问的统一入口 服务访问的负载均衡功能 服务访问的路由功能 在SpringCloud中,基于Netfl ...

  6. JVM系列四:类加载

    类的生命周期 加载->验证->准备->解析->初始化->使用->卸载 类加载过程 类加载包括以上的前五个过程:加载,验证,准备,解析,初始化 加载 1.主要完成三个 ...

  7. P1462 通往奥格瑞玛的道路[最短路+二分+堆优化]

    题目来源:洛谷 题目背景 在艾泽拉斯大陆上有一位名叫歪嘴哦的神奇术士,他是部落的中坚力量 有一天他醒来后发现自己居然到了联盟的主城暴风城 在被众多联盟的士兵攻击后,他决定逃回自己的家乡奥格瑞玛 题目描 ...

  8. vue tslint报错: Calls to 'console.log' are not allowed

    使用Vue CLI 3 的 vue create 创建vue+ts 项目,使用默认配置, 控制台报警告Calls to 'console.log' are not allowed,解决: 在tslin ...

  9. vue 对象更改检测注意事项

  10. DYNAMIC LINK LIBRARY - DLL

    https://www.tenouk.com/ModuleBB.html MODULE BB DYNAMIC LINK LIBRARY - DLL Part 1: STORY What do we h ...