我通常会编译我需要的任何东西,但我正在尝试标准化我的开发平台。我在 ubuntu 上运行开发 schroot(基础 11.10:开发 12.whatever)。
我已经安装了 boost 1.48,现在正在尝试安装 mongodb-dev。它似乎通过 libboost-dev 间接依赖于 libboost1.46-dev。对我来说,解决这个问题最干净、最长期的解决方案是什么?
我的系统状态:
(precise_amd64)hassan@hassan-ubuntu:~/dev/twit/scripts/bin$ sudo apt-get install mongodb-dev
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:
mongodb-dev : Depends: libboost-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
------------------------------------------------------------------------------------------------
(precise_amd64)hassan@hassan-ubuntu:~/dev/twit/scripts/bin$ sudo apt-get install libboost-dev
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:
libboost-dev : Depends: libboost1.46-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
-------------------------------------------------------------------------------------------------
(precise_amd64)hassan@hassan-ubuntu:~/dev/twit/scripts/bin$ sudo apt-get install libboost1.48-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost1.48-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
------------------------------------------------------------------------------------------------
答案1
正如您所注意到的,(空)包 libboost-dev 依赖于 libbost1.46-dev,而不是 libbost1.48-dev(因为一些现有软件包的问题)。
为了解决这个问题,用以下方法重建它
apt-get source libboost-dev # get the source files
cd boost-defaults*
sed -i -e "s/1.46/1.48/g" debian/control # replace 1.46 with 1.48
debuild -uc -us # rebuild the package
dpkg -i ../libboost*.deb # install it.
为此,您需要devscripts
安装该软件包。
最正确的方法是添加新的更改日志条目以debian/changelog
防止更新包。
或者,你可以使用 自己创建一个虚拟包equivs
。