Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.

ubuntu14使用apt-get安装软件提示以下信息处理方法

Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.

修复libc6

#查看系统支持的libc6版本
root@pai-worker1:~# apt-cache madison libc6
     libc6 | 2.19-0ubuntu6.15 | http://mirrors.tools.huawei.com/ubuntu/ trusty-security/main amd64 Packages
     libc6 | 2.19-0ubuntu6.15 | http://mirrors.tools.huawei.com/ubuntu/ trusty-updates/main amd64 Packages
     libc6 | 2.19-0ubuntu6 | http://mirrors.tools.huawei.com/ubuntu/ trusty/main amd64 Packages
    eglibc | 2.19-0ubuntu6 | http://mirrors.tools.huawei.com/ubuntu/ trusty/main Sources
    eglibc | 2.19-0ubuntu6.15 | http://mirrors.tools.huawei.com/ubuntu/ trusty-security/main Sources
    eglibc | 2.19-0ubuntu6.15 | http://mirrors.tools.huawei.com/ubuntu/ trusty-updates/main Sources

#删除libc6并提示依赖关系   
root@pai-worker1:~# dpkg -r libc6
dpkg: dependency problems prevent removal of libc6:amd64:
 libxau6:amd64 depends on libc6 (>= 2.4).
 liblockfile1:amd64 depends on libc6 (>= 2.14).
 lsof depends on libc6 (>= 2.14).
 libkrb5-3:amd64 depends on libc6 (>= 2.16).
 libwrap0:amd64 depends on libc6 (>= 2.14).
 python-bson-ext depends on libc6 (>= 2.14).
 the depends on libc6 (>= 2.15).
 libnfnetlink0:amd64 depends on libc6 (>= 2.14).
 policykit-1 depends on libc6 (>= 2.7).
 libitm1:amd64 depends on libc6 (>= 2.14).
 libcap2:amd64 depends on libc6 (>= 2.8).
 libxt6:amd64 depends on libc6 (>= 2.14).
 libtext-charwidth-perl depends on libc6 (>= 2.2.5).
 libgomp1:amd64 depends on libc6 (>= 2.17).
 libasyncns0:amd64 depends on libc6 (>= 2.15).
 libglib2.0-0:amd64 depends on libc6 (>= 2.17).
 libapparmor1:amd64 depends on libc6 (>= 2.14).
 less depends on libc6 (>= 2.14).
 libglib2.0-dev depends on libc6 (>= 2.4).
 libcrypt-openssl-dsa-perl depends on libc6 (>= 2.2.5).
 libblas3 depends on libc6 (>= 2.4).
 binutils depends on libc6 (>= 2.27).    #依赖版本过高,系统libc6需要为2.15版本
 vim-tiny depend
dpkg: error processing package libc6:amd64 (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 libc6:amd64

#删除版本错误的软件
root@pai-worker1:~# apt-get remove binutils

root@pai-worker1:~# dpkg --get-selections |grep libc6
libc6:amd64                                     deinstall


#重新安装libc6
root@pai-worker1:~# aptitude reinstall libc6=2.19-0ubuntu6.15
The following packages will be REINSTALLED:
  libc6
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 177 not upgraded.
Need to get 0 B/4727 kB of archives. After unpacking 0 B will be used.
Preconfiguring packages ...
Selecting previously unselected package libc6:amd64.
(Reading database ... 73015 files and directories currently installed.)
Preparing to unpack .../libc6_2.19-0ubuntu6.15_amd64.deb ...
Unpacking libc6:amd64 (2.19-0ubuntu6.15) over (2.19-0ubuntu6.15) ...
Setting up libc6:amd64 (2.19-0ubuntu6.15) ...
Processing triggers for libc-bin (2.19-0ubuntu6.15) ...

root@pai-worker1:~# dpkg --get-selections |grep libc6
libc6:amd64                                     install

root@pai-worker1:~# dpkg -l |grep libc6
ii  libc6:amd64                          2.19-0ubuntu6.15                  amd64        Embedded GNU C Library: Shared libraries





修复libc-bin

#重新安装libc-bin
apt-get download libc-bin
dpkg -x libc-bin*.deb unpackdir/

#复制文件到系统内
sudo cp unpackdir/sbin/ldconfig /sbin/

sudo apt-get install --reinstall libc-bin
sudo apt-get install -f

完成后就可以正常用apt-get安装软件了

  • apt-cache show xxx 可查看软件的依赖关系
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一、文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件) ls -a 列出当前目录文件(包括隐含文件) ls...
    小杰的简书阅读 2,527评论 0 45
  • 一、文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件)ls -a 列出当前目录文件(包括隐含文件)l...
    路痴千行阅读 2,418评论 0 5
  • apt-get 命令适用于 deb 包管理式的 Linux 操作系统(Debian、Ubuntu等),主要用于自动...
    Charles2018阅读 5,540评论 0 0
  • 一、文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件) ls -a 列出当前目录文件(包括隐含文件) ls...
    会飞的鱼Coo阅读 4,561评论 1 23
  • 《Linux学习总结》一、环境搭建:1、unbuntu 安装,制作安装盘,镜像.ISO安装包和制盘工具uiso9 ...
    土卡拉阅读 583评论 0 0