我在安装软件包时遇到了问题。dpkg 退出并出现错误:
sudo dpkg -i /var/cache/apt/archives/libglapi-mesa-lts-trusty_10.1.3-0ubuntu0.2~precise2_amd64.deb
(Reading database ... 945234 files and directories currently installed.)
Unpacking libglapi-mesa-lts-trusty (from .../libglapi-mesa-lts-trusty_10.1.3-0ubuntu0.2~precise2_amd64.deb) ...
xz: /usr/lib/x86_64-linux-gnu/liblzma.so.5: version `XZ_5.2' not found (required by xz)
dpkg-deb (subprocess): subprocess data returned error exit status 1
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing /var/cache/apt/archives/libglapi-mesa-lts-trusty_10.1.3-0ubuntu0.2~precise2_amd64.deb (--install):
subprocess dpkg-deb --fsys-tarfile returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/libglapi-mesa-lts-trusty_10.1.3-0ubuntu0.2~precise2_amd64.deb
建议运行dpkg -a --configure
,但无法解决问题。有什么建议吗?
编辑:libzlzma 实际上在那里:
$ sudo find / -name liblzma.so.5
/usr/local/lib/liblzma.so.5
/usr/lib/x86_64-linux-gnu/liblzma.so.5
/home/anaconda2/lib/liblzma.so.5
/home/anaconda2/pkgs/xz-5.2.2-0/lib/liblzma.so.5
/home/.conda/envs/outrigger-env/lib/liblzma.so.5
/home/xz-5.2.3/src/liblzma/.libs/liblzma.so.5
答案1
弄清楚了:
Anaconda2 是冲突的副本:
n$ which xz
/usr/local/bin/xz
$ xz --version
-bash: /home/acct/anaconda2/bin/xz: No such file or directory
$ echo $PATH
/home/acct/anaconda2/bin:/home/acct/perl5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
冉:
$ export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/anaconda2/ {next} {print}'`
$ xz --version
xz (XZ Utils) 5.2.3
liblzma 5.2.3
现在软件包安装正常了。不过很奇怪,因为我几个月前就安装了 anaconda,但昨天才出现错误。