如何查看为什么 apt 安装了特定的软件包版本?

如何查看为什么 apt 安装了特定的软件包版本?

当我运行时sudo apt upgrade,我得到以下信息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  wine-stable winehq-stable
0 to upgrade, 0 to newly install, 0 to remove and 2 not to upgrade.

如果我尝试sudo apt install wine-stable,它会报告存在损坏的依赖关系:

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.
 wine-stable : Depends: wine-stable-i386 (= 5.0.0~bionic)
               Depends: wine-stable-amd64 (= 5.0.0~bionic) but 4.0.3~bionic is to be installed
E: Unable to correct problems, you have held broken packages.

尽管显示“需要安装”,但实际上该版本已经安装。我运行apt list -a wine-stable-amd64后发现:

Listing... Done
wine-stable-amd64/bionic 5.0.0~bionic amd64 [upgradable from: 4.0.3~bionic]
wine-stable-amd64/bionic 4.0.4~bionic amd64
wine-stable-amd64/bionic,now 4.0.3~bionic amd64 [installed,upgradable to: 5.0.0~bionic]
wine-stable-amd64/bionic 4.0.2~bionic amd64
wine-stable-amd64/bionic 4.0.1~bionic amd64
wine-stable-amd64/bionic 4.0~bionic amd64
wine-stable-amd64/bionic 3.0.5~bionic amd64
wine-stable-amd64/bionic 3.0.4~bionic amd64
wine-stable-amd64/bionic 3.0.3~bionic amd64
wine-stable-amd64/bionic 3.0.2~bionic amd64
wine-stable-amd64/bionic 3.0.1~bionic amd64

现在在我看来,wine-stable-amd64 应该已经更新到 5.0.0~bionic,所以大概是某个软件包坚持将其保持在 4.0.3~bionic。我如何查看是哪个软件包?我试过了,apt rdepends wine-stable-amd64但列出的唯一软件包并安装这取决于它是否是...wine-stable!那么究竟发生了什么?

答案1

sudo apt-get purge'^wine'sudo apt-get dist-upgradesudo apt-get autoremovesudo apt-get cleansudo apt-get install winesudo apt-get updatesudo apt-get upgrade

我最好的猜测是应该通过终端更新计算机上的所有内容,删除与 wine 相关的所有内容,清理所有 wine 内容,重新安装更新,如果可以的话进行升级。过去几年 Wines 一直在走下坡路,使用清除命令不会造成任何影响,我保证它只会删除所有 wine 文件系统,然后重新安装 dist-upgrade 升级所有未升级的内容

答案2

我最终决定尝试一下sudo apt install wine-stable-amd64

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.
 wine-stable-amd64 : Depends: libfaudio0 but it is not installable
E: Unable to correct problems, you have held broken packages.

通过谷歌搜索,我找到了葡萄酒资讯网这解释了 wine-stable-amd64 5.0.0 所依赖的 libfaudio0 包不在 Ubuntu 18.04 的官方存储库中。它在 openSUSE Build Service 18.04 中,因此将其添加到源中允许升级继续进行。

相关内容