修复“以下软件包已被保留”-无需安装?

修复“以下软件包已被保留”-无需安装?

我最终得到了Gtk-Message:无法加载模块“overlay-scrollbar”因为overlay-scrollbar-gtk2在 64 位amd64Ubuntu 上需要 32 位 - 更好的描述在当 32 位库一直具有可卸载的依赖项时,我该如何安装 32 位库?...

基本上,如果我sudo apt-get install overlay-scrollbar-gtk2:i386,它将在 14.04 上失败,因为它被理解为依赖于overlay-scrollbar:i386,然而仅在 14.04 上overlay-scrollbar:all被安装。

所以我可以apt-get download尝试dpkg --ignore-depends ...当 32 位库一直具有可卸载的依赖项时,我该如何安装 32 位库?- 但那并没有起到什么作用……

所以我尝试按照指示如何更改依赖项,并做了如下事情:

sudo apt-get remove --purge overlay-scrollbar-gtk2:i386
apt-get download overlay-scrollbar-gtk2:i386
dpkg-deb -x overlay-scrollbar-gtk2_0.2.16+r359+14.04.20131129-0ubuntu1_i386.deb tmpdir-1404
dpkg-deb --control overlay-scrollbar-gtk2_0.2.16+r359+14.04.20131129-0ubuntu1_i386.deb tmpdir-1404/DEBIAN
nano tmpdir-1404/DEBIAN/control ## edit, see below
dpkg -b tmpdir-1404 overlay-scrollbar-gtk2_0.2.16+r359+14.04.20131129-0ubuntu1_hacked_i386.deb
# dpkg-deb: warning: 'tmpdir-1404/DEBIAN/control' contains user-defined field 'XB-Ignore'
# dpkg-deb: warning: ignoring 1 warning about the control file(s)

nano编辑中,我做的和是否忽略特定未满足的依赖关系?- 我使用 XB* 标签注释依赖关系:

...
Depends: libc6 (>= 2.4), libcairo2 (>= 1.10.0), libglib2.0-0 (>= 2.37.3), libgt$
XB-Ignore: overlay-scrollbar, # hack: ignore this dependency for i386
...

现在,安装破解的 .deb 就没有任何问题了:

$ sudo dpkg -i overlay-scrollbar-gtk2_0.2.16+r359+14.04.20131129-0ubuntu1_hacked_i386.deb
Selecting previously unselected package overlay-scrollbar-gtk2:i386.
(Reading database ... 227214 files and directories currently installed.)
Preparing to unpack overlay-scrollbar-gtk2_0.2.16+r359+14.04.20131129-0ubuntu1_hacked_i386.deb ...
Unpacking overlay-scrollbar-gtk2:i386 (0.2.16+r359+14.04.20131129-0ubuntu1) ...
Setting up overlay-scrollbar-gtk2:i386 (0.2.16+r359+14.04.20131129-0ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...

看起来不错(实际上,似乎不错 - 因为当我运行 32 位程序时,以前会抱怨Gtk-Message: Failed to load module "overlay-scrollbar"这个,但现在它们不再抱怨了) - 但是现在当我执行 时apt-get upgrade,我收到了“软件包已被保留”消息:

$ sudo apt-get update
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  overlay-scrollbar-gtk2:i386
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

...但更奇怪的是,当我这样做的时候apt-get dist-upgrade有任何警告吗?!:

$ sudo apt-get dist-upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

这一页apt-get dist-upgrade 无法修复‘以下软件包已被保留’还指出:

这意味着它们被保留下来的原因比新的依赖关系或需要删除其他包更困难。

那么,有人知道 - 在这种情况下“保留”包的原因是什么 - 以及如何在执行时摆脱该警告update?显然,我不想apt-get install在这里执行该包,因为它被黑客入侵了,我想直接从 .deb 安装它 - 并且apt-get无法直接安装 .deb 文件,只能dpkg这样做......


编辑:正如@ByteCommander 在评论中所建议的那样,我尝试过aptitude

$ sudo aptitude upgrade 
Resolving dependencies...                
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

这并没有说明什么——以下更具启发性:

$ sudo aptitude full-upgrade 
The following packages will be upgraded: 
  overlay-scrollbar-gtk2:i386{b} 
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 29.3 kB of archives. After unpacking 0 B will be used.
The following packages have unmet dependencies:
 overlay-scrollbar-gtk2:i386 : Depends: overlay-scrollbar:i386 which is a virtual package.
The following actions will resolve these dependencies:

     Remove the following packages:
1)     overlay-scrollbar-gtk2:i386 

Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.

overlay-scrollbar:i386嗯...我以为我已经删除了对??!的依赖。

此外,以下是apt-cache policy根据@ByteCommander 的评论:

$ apt-cache policy overlay-scrollbar:i386 overlay-scrollbar
overlay-scrollbar:i386:
  Installed: (none)
  Candidate: (none)
  Version table:
overlay-scrollbar:
  Installed: 0.2.16+r359+14.04.20131129-0ubuntu1
  Candidate: 0.2.16+r359+14.04.20131129-0ubuntu1
  Version table:
 *** 0.2.16+r359+14.04.20131129-0ubuntu1 0
        500 http://dk.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy overlay-scrollbar-gtk2:i386 overlay-scrollbar-gtk2
overlay-scrollbar-gtk2:i386:
  Installed: 0.2.16+r359+14.04.20131129-0ubuntu1
  Candidate: 0.2.16+r359+14.04.20131129-0ubuntu1
  Version table:
     0.2.16+r359+14.04.20131129-0ubuntu1 0
        500 http://dk.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
 *** 0.2.16+r359+14.04.20131129-0ubuntu1 0
        100 /var/lib/dpkg/status
overlay-scrollbar-gtk2:
  Installed: 0.2.16+r359+14.04.20131129-0ubuntu1
  Candidate: 0.2.16+r359+14.04.20131129-0ubuntu1
  Version table:
 *** 0.2.16+r359+14.04.20131129-0ubuntu1 0
        500 http://dk.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

嗯...可能与...有关/var/lib/dpkg/status,但还不确定是什么...

答案1

好的,我想我已经解决了 - 但我不确定它会有多么持久......

基本上,到目前为止,我假设仅有的包的依赖项定义是.deb文件中所注明的内容,正如 OP 所指出的,该文件已被使用XB-Ignore:“注释”标签破解。

但事实并非如此——事实上有一个额外的定义依赖项的文件,这在输出中提示apt-cache policy overlay-scrollbar-gtk2:i386

  Version table:
     0.2.16+r359+14.04.20131129-0ubuntu1 0
        500 http://dk.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
 *** 0.2.16+r359+14.04.20131129-0ubuntu1 0
        100 /var/lib/dpkg/status

因此,有一个定义/var/lib/dpkg/status- 它基本上在安装包时XB-Ignore:从被黑客入侵的地方继承了标签。.deb

但是,我们被告知似乎还有另一个规范http://dk.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages- 但是,显然,这不是文件名,而是deb使用的规范/etc/apt/sources.list。那么,与此相关的文件在哪里?事实证明,它在(在我的情况下):

/var/lib/apt/lists/dk.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-i386_Packages

因此,我意识到在这个文件中,我有一个“未被破解的”原始规范:

Package: overlay-scrollbar-gtk2
Priority: optional
Section: libs
Installed-Size: 118
Maintainer: Ubuntu Desktop Team <[email protected]>
Architecture: i386
Source: overlay-scrollbar
Version: 0.2.16+r359+14.04.20131129-0ubuntu1
Replaces: liboverlay-scrollbar-0.2-0 (<< 0.2.16+r348), liboverlay-scrollbar-0.2-dev (<< 0.2.16+r348)
Depends: overlay-scrollbar, libc6 (>= 2.4), libcairo2 (>= 1.10.0), libglib2.0-0 (>= 2.37.3), libgtk2.0-0 (>= 2.24.6-0ubuntu4)
Conflicts: liboverlay-scrollbar-0.2-0 (<< 0.2.16+r348), liboverlay-scrollbar-0.2-dev (<< 0.2.16+r348)
Filename: pool/main/o/overlay-scrollbar/overlay-scrollbar-gtk2_0.2.16+r359+14.04.20131129-0ubuntu1_i386.deb
Size: 29286
MD5sum: 261bcaed3e0a73ebab73c25514dfdab5
SHA1: eec7a0e958ce41a441883ce305de2fc8ff4e8aac
SHA256: 4f18ad70e6ce0fbb59e79d2ca8fc43ffafd13011dc3db0dcd65bffeddf23379b
Description: GTK 2 module for overlay scrollbars
Multi-Arch: same
Homepage: http://launchpad.net/ayatana-scrollbar
Description-md5: 1d3f21e2d8af7452b22c5b3bf608dfba
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: ubuntu-desktop, ubuntu-usb, edubuntu-desktop, edubuntu-usb

啊,又是同样的问题Depends:——所以我尝试将 Depends 行替换为以下内容:

Depends: libc6 (>= 2.4), libcairo2 (>= 1.10.0), libglib2.0-0 (>= 2.37.3), libgtk2.0-0 (>= 2.24.6-0ubuntu4)
XB-Ignore: overlay-scrollbar, # hack: ignore this dependency for i386

...所以现在,这两个文件都/var/lib/dpkg/status显示相同的依赖关系 - 现在当我这样做时upgrade

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

... 我没有遇到其他问题... 希望就是这样。

相关内容