安装 default-jre 时未满足的依赖关系

安装 default-jre 时未满足的依赖关系

尝试安装 default-jre 时出现以下错误。我该如何解决这个问题?

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.

The following information may help to resolve the situation:

The following packages have unmet dependencies:
default-jre : Depends: default-jre-headless (= 1:1.7-43ubuntu4) but it is not going to be installed
Depends: openjdk-7-jre (>= 7~u3-2.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

答案1

使用 aptitude 代替 apt,

sudo apt-get install aptitude
sudo aptitude -f install

答案2

尝试代码:

sudo apt-get update

更新你的软件包列表。然后代码:

sudo apt-get autoclean

清理任何不完整的包。然后代码:

sudo apt-get clean

清理 apt 缓存。代码:

sudo apt-get autoremove

将清除所有不需要的依赖项。如果在执行此操作时您可以识别损坏的包,此代码将非常强制地将其删除。代码:

sudo dpkg --remove -force --force-remove-reinstreq package name

当然是将包名称更改为真实名称。

相关内容