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 可查看软件的依赖关系