libdevmapper 未满足的依赖关系

libdevmapper 未满足的依赖关系

我正在尝试从 Ubuntu 12.04 (64bit) LTS 上的源代码安装 libvirt 1.2.7。为了编译 libvirt,libdevmapper-dev需要。安装时出现以下错误libdevmapper-dev

# apt-get install libdevmapper-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:
libdevmapper-dev : Depends: libdevmapper1.02.1 (= 2:1.02.48-4ubuntu7.4) but 2:1.02.90-2ubuntu1 is to be installed
                   Depends: libdevmapper-event1.02.1 (= 2:1.02.48-4ubuntu7.4) but 2:1.02.90-2ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

我也尝试过使用 安装,aptitude但它要求删除其他几个必要的库,例如liblvm2cmd2.02。此外,我无法将系统升级到更高版本的 ubuntu。

apt-cache policy给出以下输出。

# apt-cache policy libdevmapper1.02.1
libdevmapper1.02.1:
  Installed: 2:1.02.90-2ubuntu1
  Candidate: 2:1.02.90-2ubuntu1
  Version table:
 *** 2:1.02.90-2ubuntu1 0
        100 /var/lib/dpkg/status
     2:1.02.48-4ubuntu7.4 0
            500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
     2:1.02.48-4ubuntu7 0
            500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

我该如何解决这种依赖关系?

答案1

您必须降级一些软件包并强制安装其他一些软件包:

apt-get download dmsetup
sudo dpkg -i --force-all dmsetup
sudo apt-get install libdevmapper1.02.1=2:1.02.48-4ubuntu7.4 libdevmapper-event1.02.1=2:1.02.48-4ubuntu7.4

可能还有一些其他包,但只有在运行命令时才会知道这一点。

相关内容