我在离线安装软件包时遇到问题。例如,python-qt4
模块需要sip-api-8.1
但它是一个虚拟软件包,因此没有要安装的 .deb 文件。我该如何解决这种情况?我知道软件包python-sip
提供了它,但我正在寻找一个通用的解决方案。
$ apt-cache show python-qt4
Package: python-qt4
Priority: optional
Section: python
Installed-Size: 12103
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Python Modules Team <[email protected]>
Architecture: i386
Version: 4.9.1-2ubuntu1
Replaces: python-qt4-dev (<< 4.4.4-3~)
Provides: python2.7-qt4
Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.8), libc6 (>= 2.3), libgcc1 (>= 1:4.1.1), libpython2.7 (>= 2.7), libqt4-dbus (>= 4:4.8.0-1~), libqt4-declarative (>= 4:4.8.0-1~), libqt4-designer (>= 4:4.8.0-1~), libqt4-help (>= 4:4.8.0-1~), libqt4-network (>= 4:4.8.0-1~), libqt4-script (>= 4:4.8.0-1~), libqt4-scripttools (>= 4:4.8.0-1~), libqt4-svg (>= 4:4.8.0-1~), libqt4-test (>= 4:4.8.0-1~), libqt4-xml (>= 4:4.8.0-1~), libqt4-xmlpatterns (>= 4:4.8.0-1~), libqtassistantclient4 (>= 4.6.3), libqtcore4 (>= 4:4.8.0-1~), libqtgui4 (>= 4:4.8.0-1~), libqtwebkit4 (>= 2.2~2011week36), libstdc++6 (>= 4.1.1), sip-api-8.1
Suggests: python-qt4-dbg
然而:
$ apt-cache show sip-api-8.1
N: Can't select versions from package 'sip-api-8.1' as it is purely virtual
编辑: 这个怎么选择python-sip而不是原来的呢?
$ apt-get install -s sip-api-8.1
Reading state information... Done
Note, selecting 'python-sip' instead of 'sip-api-8.1'
答案1
因为python-sip
提供sip-api-8.1
:
$ apt-cache show python-sip | grep Provides
Provides: python2.7-sip, sip-api-8.0, sip-api-8.1
你怎么能自己发现这一点呢?
$ aptitude show sip-api-8.1
No current or candidate version found for sip-api-8.1
Package: sip-api-8.1
State: not a real package
Provided by: python-sip
或者,使用 grep-dctrl dctrl-tools
:
$ grep-aptavail -F Provides -s Package,Provides sip-api-8.1
Package: python-sip
Provides: python2.7-sip, sip-api-8.0, sip-api-8.1