经过几轮安装和删除,尝试让 Atlas 和 OpenBLAS 相互成为朋友,我遇到了这个更新替代方案错误,我认为这实际上是主从死锁,即。一些符号链接应该是从属的,但实际上是主的。请告知如何修复此问题。
我的设置:ubuntu 12.04
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up libatlas3gf-base (3.8.4-3build1) ...
update-alternatives: error: alternative libatlas.so.3gf can't be slave of libblas.so.3gf: it is a master alternative.
dpkg: error processing libatlas3gf-base (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
libatlas3gf-base
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo dpkg --configure -a
Setting up libatlas3gf-base (3.8.4-3build1) ...
update-alternatives: error: alternative libatlas.so.3gf can't be slave of libblas.so.3gf: it is a master alternative.
dpkg: error processing libatlas3gf-base (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
libatlas3gf-base
编辑 :
$ update-alternatives --query libblas.so.3gf
update-alternatives: error: no alternatives for libblas.so.3gf.
$ update-alternatives --query libatlas.so.3gf
Link: libatlas.so.3gf
Status: auto
Best: /usr/local/lib/libopenblas.so
Value: none
Alternative: /usr/local/lib/libopenblas.so
Priority: 50
答案1
我修复了自己的主从死锁,下面是那条神奇的线,
sudo dpkg --remove --force-remove-reinstreq libatlas3gf-base
之后我发出了“sudo apt-get -f install”,不再看到任何投诉。
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
注:在另一篇文章中(http://ubuntuforums.org/showthread.php?t=947124)有人建议
"sudo dpkg --remove -force --force-remove-reinstreq package name"
'-force' 确实没有必要。
答案2
我无法让 horaceT 的答案起作用。相反,我发出了以下命令,这些命令虽然报错,但阻止了失败apt-get install
。
sudo update-alternatives --config liblapack.so.3gf
sudo update-alternatives --config libblas.so.3gf
答案3
只是为了记忆:在这个答案建议
sudo update-alternatives --remove-all liblapack.so.3gf
sudo apt-get install -f
这对我有帮助。