由于依赖性问题,apt-get升级失败

我正在尝试升级,同时这样做,我得到以下内容:

devteam@hephaestusx:~/Projects$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: libboost-python-dev : Depends: libboost-python1.46-dev but it is not installed E: Unmet dependencies. Try using -f. devteam@hephaestusx:~/Projects$ apt-get -f install E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? devteam@hephaestusx:~/Projects$ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: libboost-python1.46-dev libboost1.46-dev Suggested packages: libboost1.46-doc libboost-date-time1.46-dev libboost-filesystem1.46-dev libboost-graph1.46-dev libboost-iostreams1.46-dev libboost-math1.46-dev libboost-program-options1.46-dev libboost-random1.46-dev libboost-regex1.46-dev libboost-serialization1.46-dev libboost-signals1.46-dev libboost-system1.46-dev libboost-test1.46-dev libboost-thread1.46-dev libboost-wave1.46-dev doxygen default-jdk fop The following NEW packages will be installed: libboost-python1.46-dev libboost1.46-dev 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. 6 not fully installed or removed. Need to get 0 B/8,151 kB of archives. After this operation, 80.1 MB of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 226442 files and directories currently installed.) Unpacking libboost1.46-dev (from .../libboost1.46-dev_1.46.1-5ubuntu2_amd64.deb) ... dpkg: error processing /var/cache/apt/archives/libboost1.46-dev_1.46.1-5ubuntu2_amd64.deb (--unpack): trying to overwrite '/usr/include/boost/aligned_storage.hpp', which is also in package libboost1.40-dev 1.40.0-6ubuntu1 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Unpacking libboost-python1.46-dev (from .../libboost-python1.46-dev_1.46.1-5ubuntu2_amd64.deb) ... dpkg: error processing /var/cache/apt/archives/libboost-python1.46-dev_1.46.1-5ubuntu2_amd64.deb (--unpack): trying to overwrite '/usr/lib/libboost_python-py26.a', which is also in package libboost-python1.40-dev 1.40.0-6ubuntu1 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/libboost1.46-dev_1.46.1-5ubuntu2_amd64.deb /var/cache/apt/archives/libboost-python1.46-dev_1.46.1-5ubuntu2_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

关于如何解决这个问题的任何想法?

您目前安装了Maverick的libboost1.40-all-dev 。 现在您尝试从Oneiric安装libboost1.46-dev 。 它与libboost-python1.46-dev类似。

这不起作用,混合来自不同版本的Ubuntu的软件包仅适用于极少数特殊情况。

尝试删除包libboost-python1.46-devlibboost1.46-dev

apt-get upgrade也需要root权限,因此:

sudo apt-get update && sudo apt-get upgrade