Ubuntu 12.04 libudev-dev will not install due to dependencies

I have an example C ++ code that accepts hotplug events using the udev library. It worked great on Ubuntu 10.04. This was a prerequisite for the libudev-dev package: sudo apt-get install libudev-dev

But when I tried to install this package in 12.04, I get:

sudo apt-get install libudev-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: libudev-dev : Depends: libudev0 (= 175-0ubuntu9) but 175-0ubuntu9.3 is to be installed E: Unable to correct problems, you have held broken packages. 

This seems to imply that I should install libudev0, therefore:

 sudo apt-get install libudev0 Reading package lists... Done Building dependency tree Reading state information... Done libudev0 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 

I am not sure how to proceed from here. libudev-dev depends on libudev0, but what's already in place, so ... what's next?

Please note that the following repositories are not commented on in sources.list, and I did apt-get update:

 deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted deb http://us.archive.ubuntu.com/ubuntu/ precise universe deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe 

Some sites indicated that I should do -f:

 sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 

Found a great link here: https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies but without joy.

Google says it's a slam for other people out there ...

Thanks for any help on this, John

+7
source share
3 answers

Here is the solution.

When you read the following:

 The following packages have unmet dependencies: libudev-dev : Depends: libudev0 (= 175-0ubuntu9) but 175-0ubuntu9.3 is to be installed E: Unable to correct problems, you have held broken packages. 

this means that the libudev-dev package I'm trying to install depends on the package:

 libudev0 version 175-0ubuntu9 

(This is what trying to say " (= 175-0ubuntu9) )

But the libudev0 175-0ubuntu9.3 version is already installed.

(This is what trying to say, " but 175-0ubuntu9.3 ).

So in other words:

  • A new version of libudev0 has already been installed.
  • The libudev-dev package I'm trying to install depends on the old version of libudev0 older and already installed.
  • which in turn means that the repository from which I am installing libudev-dev is out of date.

You can find packages available in all repositories that you currently specify in /etc/apt/sources.list, by:

 sudo apt-cache madison libudev-dev sudo apt-cache madison libudev0 

So, we got to the REAL problem! On my repository list in sources.list is missing the one that contains libudev-dev 175-0ubuntu9.3.

To fix this:

  • go to http://packages.ubuntu.com and find "libudev-dev"

  • In the list, find 175-0ubuntu9.3 for Precise Pangolin (ubuntu 12.04). In this case, this version is under the "exact version". You can click on the link:

    http://packages.ubuntu.com/precise-updates/libudev-dev

    which shows everything you wanted to know about libudev-dev. Also, it does not show the exact repo url I have to use! So I'm going to guess a little ...

  • add repos to apt

     sudo gedit /etc/apt/sources.list [ add these two repos ] deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main 
  • refresh

     sudo apt-get update sudo apt-cache madison libudev-dev [you should see libudev-dev 175-0ubuntu9.3 in the output] libudev-dev | 175-0ubuntu9.3 | http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages 
  • install package:

     sudo apt-get install libudev-dev 

    which works like a charm!

John

+13
source

Not. Doesn't work like a charm.

@ubuntu: ~ $ sudo apt-cache madison libudev-dev

libudev-dev | 175-0ubuntu9.8 | http://archive.ubuntu.com/ubuntu/ Accurate updates / amd64 core packages

libudev-dev | 175-0ubuntu9.8 | http://us.archive.ubuntu.com/ubuntu/ Exact updates / amd64 core packages

ubuntu: ~ $ sudo apt-get install libudev-dev

Paketlisten werden gelesen ... Fertig

Abhängigkeitsbaum wird aufgebaut

Status information that he was ... Fertig

version of libudev-dev ist schon die neueste.

Siren "apt-get -f install", um dies zu korrigieren:

Streamline people as much as possible:

libudev-dev: Hängt ab von: libudev0 (= 175-0ubuntu9.8) aber 175-0ubuntu9 soll installiert werden

libudev0: Beschädigt: libudev0: i386 (! = 175-0ubuntu9) aber 175-0ubuntu9.8 soll installiert werden

libudev0: i386: Beschädigt: libudev0 (! = 175-0ubuntu9.8) aber 175-0ubuntu9 soll installiert werden

E: Unerfüllte Abhängigkeiten. Versuchen Sie "apt-get -f install" ohne Angabe eines Pakets (another goben Sie eine Lösung an).

THIS DID :

apt-get download libudev0 libudev0: i386

sudo dpkg -i libudev0 _ *. deb

sudo apt-get upgrade

+1
source

This is what worked for me:

  • sudo apt-mark hold libudev0: i386
  • sudo apt-mark hold libudev0
  • sudo apt-get upgrade
  • Then I went to the synaptic and marked libudev for the update (probobly would also work via the command line. Just not the way I did it)
0
source

All Articles