我正在使用 ubuntu 10.10,最近我的包管理器因为依赖项或其他问题而停止工作。我根本无法升级、安装或卸载任何东西。这是一个大问题。我在谷歌上找不到解决方案,所以我在这里寻求帮助。
这是 apt-get -f install 的输出
LANG=en_US.UTF-8 sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
firefox-4.0-core
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up openjdk-6-jre-headless (6b20-1.9.5-0ubuntu1) ...
update-alternatives: error: alternative path /usr/lib/jvm/java-6-openjdk/jre/bin/java doesn't exist.
dpkg: error processing openjdk-6-jre-headless (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
openjdk-6-jre-headless
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我只需重新安装该软件包...
sudo mv /var/lib/dpkg/info/openjdk-6-jre-headless.postinst /var/lib/dpkg/info/openjdk-6-jre-headless.postinst.bad
sudo apt-get --reinstall install openjdk-6-jre-headless
答案2
看起来你的 Java 安装已经损坏。
尝试sudo apt-get purge openjdk-jre
。
然后我建议勾选 synaptic 中的“合作伙伴”存储库,重新加载并安装 Sun 的 JRE sudo apt-get install sun-java6-jre
。