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

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

我正在尝试升级,在升级过程中,出现以下情况:

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)

有什么办法可以解决这个问题吗?

答案1

您目前已libboost1.40-all-dev安装来自 Maverick 的。现在您正在尝试安装libboost1.46-dev来自 Oneiric 的。与 类似libboost-python1.46-dev

这不起作用,混合来自不同版本 Ubuntu 的软件包只有在极少数特殊情况下才有效。

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

答案2

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

sudo apt-get 更新 && sudo apt-get 升级

相关内容