由于循环依赖,libboost-dev 无法安装

由于循环依赖,libboost-dev 无法安装

在 Ubuntu 12.04 上安装 libboost-dev:

由于不可改变的情况,系统处于离线状态,因此我必须下载库并使用“dpkg”手动安装。

Ubuntu 软件包存储库显示 libboost-dev12.04 的版本是 1.48.0.2,并且依赖于“libboost1.46-dev”

我有另一个在线系统,具有相同的设置,我查询了它以找出安装了哪个 libboost-dev 包。这确认了 1.48.02:

 ~$ dpkg -l libboost-dev
 Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                        Version                                     Description
+++-===========================================-===========================================-======================================================================================================
ii  libboost-dev                                1.48.0.2                                    Boost C++ Libraries development files (default version)

所以我下载了这两个包,并手动将它们复制到离线系统,

libboost1.46-dev_1.46.1
libboost-dev_1.48.0.2

并尝试安装:

~$ sudo dpkg -i libboost*
dpkg: considering removing libboost1.48-dev in favour of libboost1.46-dev ...
dpkg: no, cannot proceed with removal of libboost1.48-dev (--auto-deconfigure will help):
libboost-timer1.48-dev depends on libboost1.48-dev (= 1.48.0-3)
libboost1.48-dev is to be removed.
dpkg: regarding libboost1.46-dev_1.46.1-7ubuntu3_amd64.deb containing libboost1.46-dev:
libboost1.48-dev conflicts with libboost1.46-dev
libboost1.46-dev (version 1.46.1-7ubuntu3) is to be installed.
dpkg: error processing libboost1.46-dev_1.46.1-7ubuntu3_amd64.deb (--install):
conflicting packages - not installing libboost1.46-dev
(Reading database ... 217276 files and directories currently installed.)
Preparing to replace libboost-dev 1.48.0.2 (using libboost-dev_1.48.0.2_amd64.deb) ...
Unpacking replacement libboost-dev ...
dpkg: dependency problems prevent configuration of libboost-dev:
libboost-dev depends on libboost1.46-dev; however:
Package libboost1.46-dev is not installed.
dpkg: error processing libboost-dev (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libboost1.46-dev_1.46.1-7ubuntu3_amd64.deb
libboost-dev

'dpkg' 首先考虑替换似乎已安装的 1.48,但后来无法替换,因为有太多东西依赖于它。然后它说“libboost1.48-dev 与 libboost1.46-dev 冲突”。

我的在线系统显示两个包都已安装,但是我的离线系统无法安装,并且包仅被解压:

 ~$ dpkg -l libboost-dev
 Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                        Version                                     Description
+++-===========================================-===========================================-======================================================================================================
iU  libboost-dev                                1.48.0.2                                    Boost C++ Libraries development files (default version)

dpkg 无法安装这个,这是怎么回事?

答案1

我对此做了进一步的研究。

我不知道如何(因为这个系统是离线的),但是 libboost*1.48 软件包都安装了,禁止安装 libboost1.46 软件包(这是 12.04 标准安装)。

因为我想要的只是标准安装包,所以我执行了:

sudo dpkg -r libboost-*1.48.-dev
sudo dpkg -i libboost1.46-dev_1.46.1-7ubunut3_amd64.deb libboost-dev_1.48.0.2_amd64.deb

至此安装成功

相关内容