ubuntu 12.04 安装 boost 失败,have unmet dependencies,held broken packages 问题

来源:互联网 发布:驱动精灵网络连接错误 编辑:程序博客网 时间:2024/05/23 02:06

1. 问题

$ sudo apt-get install libboost-all-devReading package lists... DoneBuilding dependency tree       Reading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies: libboost-all-dev : Depends: libboost-iostreams-dev but it is not going to be installed                    Depends: libboost-python-dev but it is not going to be installed                    Depends: libboost-regex-dev but it is not going to be installedE: Unable to correct problems, you have held broken packages.

2. 解决方法

查看 hold packages$ dpkg --get-selections | grep hold如果没有,使用 aptitude 安装$ sudo apt-get install aptitude$ sudo aptitude install libboost-all-dev

3. aptitude vs apt-get

http://askubuntu.com/questions/1743/is-aptitude-still-considered-superior-to-apt-get


参考:

http://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages

http://superuser.com/questions/428033/why-use-the-command-apt-get-purge-remove-over-apt-get-purge-in-linux

http://www.linuxquestions.org/questions/ubuntu-63/how-to-fix-broken-package-904637/


之后在装 vim-gnome 时,又碰到 have unmet dependencies,held broken packages 问题。用 aptitude 装则选项太多,不是很有把握。以前 apt-get 也没碰到这么多 broken packages 的问题阿,干脆怀疑是不是系统出了啥问题?是不是之前装 ark(使用kde)时装的kde依赖与gnome有版本冲突。

于是卸了 ark 和 kde 依赖,最后还是不行。于是想查是不是有 broken package,但 dpkg --get-selections | grep hold 并没有输出。我又怀疑这个工具是不是不能较好的显示 broken package,于是又装了 synaptic 包管理,结果里面依然没有 broken package。

用 sudo apt-get update 时会出现,Failed to fetch http://ppa.launchpad.net/shawn-p-huang/ppa/ubuntu/dists/precise/main/source/Sources 404 Not Found 的 error,于是在 /etc/apt/sources.list.d 目录里删掉这些ppa,再 update 成功,再装 vim-gnome 还是失败。

最后想是不是默认源有问题,索性换成 163 的源,再 update,再装,就成功了。




原创粉丝点击