无法升级我的 Ubuntu 服务器,它卡在 openjdk-6-jre-headless

无法升级我的 Ubuntu 服务器,它卡在 openjdk-6-jre-headless

我正在使用 Ubuntu Server。

当我做:

apt-get 升级

它卡在了:

设置 openjdk-6-jre-headless (6b20-1.9.7-0ubuntu1) ...

为什么?我该怎么做才能阻止它?

我尝试使用 apt-get 将其删除...但出现此错误:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

因此我尝试了这个:

dpkg --purge openjdk-6-jre-headless

我懂了:

dpkg: dependency problems prevent removal of openjdk-6-jre-headless:
 openjdk-6-jre-lib depends on openjdk-6-jre-headless (>= 6b17).
 ca-certificates-java depends on openjdk-6-jre-headless (>= 6b16-1.6.1-2) | java6-runtime-headless; however:
  Package openjdk-6-jre-headless is to be removed.
  Package java6-runtime-headless is not installed.
  Package openjdk-6-jre-headless which provides java6-runtime-headless is to be removed.
 ca-certificates-java depends on openjdk-6-jre-headless (>= 6b16-1.6.1-2) | java6-runtime-headless; however:
  Package openjdk-6-jre-headless is to be removed.
  Package java6-runtime-headless is not installed.
  Package openjdk-6-jre-headless which provides java6-runtime-headless is to be removed.
dpkg: error processing openjdk-6-jre-headless (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 openjdk-6-jre-headless

问题是我认为我的数据库正在使用它...不确定...我正在将 Cassandra 与 Thrift 一起使用...

是的,它变得有点复杂...

# dpkg --configure -a

我得到:

dpkg: dependency problems prevent configuration of openjdk-6-jre:
 openjdk-6-jre depends on openjdk-6-jre-headless (>= 6b20-1.9.7-0ubuntu1); however:
  Package openjdk-6-jre-headless is not configured yet.
dpkg: error processing openjdk-6-jre (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
dpkg: dependency problems prevent configuration of libaccess-bridge-java:
 libaccess-bridge-java depends on default-jre | openjdk-6-jre | sun-java6-jre; however:
  Package default-jre is not installed.
  Package openjdk-6-jre is not configured yet.
  Package sun-java6-jre is not installed.
dpkg: error processing libaccess-bridge-java (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of icedtea-6-jre-cacao:
 icedtea-6-jre-cacao depends on openjdk-6-jre-headless (= 6b20-1.9.7-0ubuntu1); however:
  Package openjdk-6-jre-headless is not configured yet.
dpkg: error processing icedtea-6-jre-cacao (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libaccess-bridge-java-jni:
 libaccess-bridge-java-jni depends on libaccess-bridge-java (>= 1.26.2-5); however:
  Package libaccess-bridge-java is not configured yet.
dpkg: error processing libaccess-bridge-java-jni (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 openjdk-6-jre
 libaccess-bridge-java
 icedtea-6-jre-cacao
 libaccess-bridge-java-jni

再次感谢任何帮助。

答案1

我以前很少遇到类似这样的升级问题。

两种可能性,尝试一下:

apt-get update

然后

apt-get upgrade

失败的话,尝试

apt-get remove openjdk-6-jre-headless

然后

apt-get upgrade

然后

apt-get install openjdk-6-jre-headless

答案2

Cassandra 是一个 Java 应用程序,根据您运行的版本,它需要不同的 Java 包。过去它需要 openjdk,但我相信新版本将接受 sunJDK。您必须拥有其中一个才能使其工作。

答案3

dpkg -C将审核您的系统中是否存在配置错误或不起作用的软件包,然后推荐解决方案。

您也应该尝试手动删除依赖树的顶部:您是否尝试过删除ca-certificates-java?如果删除失败,您可以删除它的依赖者,依此类推。

作为最后的手段:如果您dpkg使用该--force-depends标志运行,所有依赖性错误都会自动变成警告。当然,这允许您破坏系统;请谨慎使用。当然,首先包含该--dry-run选项以检查所做的事情是否是您想要的。

相关内容