1

I am trying to install libvirt 1.2.7 from sources on Ubuntu 12.04 (64bit) LTS. In order to compile libvirt, libdevmapper-dev is required. I a getting following error while installing 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.

I have also tried installation with aptitude but it asks for removal several other necessary libraries e.g. liblvm2cmd2.02. Moreover I can not afford to upgrade system to later ubuntu versions.

apt-cache policy gives following output.

# 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

How can I resolve this dependency?

Waqas
  • 789
  • 3
  • 11
  • 19

1 Answers1

0

You have to downgrade some packages and to force the installation of some other packages:

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

Probably some other packages as well, but you will know this only when you run the commands.

A.B.
  • 90,397
  • apt did not find the version, sudo apt-get install libdevmapper1.02.1= 2:1.02.48-4ubuntu7.4 Reading package lists... Done Building dependency tree Reading state information... Done E: Version '' for 'libdevmapper1.02.1' was not found E: Unable to locate package 2:1.02.48-4ubuntu7.4 E: Couldn't find any package by regex '2:1.02.48-4ubuntu7.4' – Waqas Dec 07 '15 at 07:36
  • I know, that was a typo. I've my answer corrected. – A.B. Dec 07 '15 at 07:40
  • still no success :( # sudo apt-get install libdevmapper1.02.1=2:1.02.48-4ubuntu7.4 libdevmapper-event1.02.1=2:1.02.48-4ubuntu7.4 The following packages have unmet dependencies: libdevmapper1.02.1 : Depends: dmsetup (>= 2:1.02.48-4ubuntu7.4) also tried apt-get install dmsetup=2:1.02.48-4ubuntu7.4 but it gives this error: dmsetup : Depends: libdevmapper1.02.1 (>= 2:1.02.47) but it is not going to be installed – Waqas Dec 07 '15 at 07:51
  • The output of apt-cache policy dmsetup please. – A.B. Dec 07 '15 at 07:53
  • #apt-cache policy dmsetup dmsetup: 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 – Waqas Dec 07 '15 at 07:54
  • 1
    Answer updated. – A.B. Dec 07 '15 at 07:59