Ubuntu – Can’t install libudev-dev on Ubuntu 16.04

16.04

I cant seem to find a solution for installing libudev-dev package.
It outputs this error

The following packages have unmet dependencies:
libudev-dev : Depends: libudev1 (= 229-4ubuntu4) but 229-4ubuntu5 is to be installed

So i tried
sudo apt-get install libudev1

libudev1 is already the newest version (229-4ubuntu5).

You may have notice that in my machine a latest version of it is installed. which is 229-4ubuntu5
I also tried what was suggested here.
https://stackoverflow.com/questions/17181073/ubuntu-12-04-libudev-dev-wont-install-because-of-dependencies

sudo apt-cache madison libudev-dev

sudo apt-cache madison libudev1

sudo apt-get install libudev-dev

But I still get the same error.
Can someone help me with this?

Best Answer

My guess is that there is a simple mix-up in the control file of that archive, you should report that as a bug.

However a actual workaround could be this very dirty hack, which can as well break things!

Download the package from here then open a terminal and switch to your Downloads folder.

There unpack the .deb archive with:

dpkg-deb -R libudev-dev_229-4ubuntu4_amd64.deb tmp

Then change one line inside the tmp/DEBIAN/control file:

sed -i 's/229-4ubuntu4/229-4ubuntu5/' tmp/DEBIAN/control

After this repack the .deb file with (I choose here to give it a different name)

dpkg-deb -b tmp libudev-dev_229-fixbuntu_amd64.deb

Now you can install it after you made sure you have all dependencies installed already with:

dpkg -i libudev-dev_229-fixbuntu_amd64.deb

Note: This fix might work, but it can as well break things if there are really changes which are not taken into account properly by the maintainers. So understand you do this hack at your own risk.

Related Question