Missing libudev.h
On a fully up to date Raspberry pi 5 running RaspiOS bookworm, f3write and f3read compile and run correctly.
When I try to compile f3probe and f3fix with sudo make install-extra I get this:
cc -std=c99 -Wall -Wextra -pedantic -MMD -ggdb -c -o libdevs.o libdevs.c
libdevs.c:21:10: fatal error: libudev.h: No such file or directory
21 | #include <libudev.h>
| ^~~~~~~~~~~
compilation terminated.
make: *** [
I then tried on Ubuntu 24.02, also up to date, running on i7-3770 and f3write and f3read worked but trying to compile f3probe and f3fix gave the same error.
I tried sudo apt-get install libudev-dev but that reported The following packages have unmet dependencies: libudev-dev : Depends: libudev1 (= 252.38-1~deb12u1) but 254.26-1~bpo12+1 is to be installed
I found this, https://github.com/systemd/systemd/tree/main/src/libudev but don't know how to install it. Forgive my ignorance.
Can anyone offer advice please?
Thanks
Could you try the steps in section The extra applications for Linux of the README file to see if they address your problem?
Thank you
The result is as follows:
sudo apt-get install libudev1 libudev-dev libparted-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done libudev1 is already the newest version (254.26-1~bpo12+1). 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: libudev1 (= 252.38-1~deb12u1) but 254.26-1~bpo12+1 is to be installed E: Unable to correct problems, you have held broken packages.
I then found https://thelinuxcode.com/fix-broken-packages-raspberry-pi/ This gives many steps to help fix the held broken packages problem as follows:
sudo apt --fix-missing update sudo apt --fix-broken install sudo apt install -f sudo apt full-upgrade sudo dpkg --configure -a sudo dpkg -l | grep ^..r sudo apt clean sudo apt update sudo apt full-upgrade
I ran these step by step, trying sudo apt-get install libudev1 libudev-dev libparted-dev each time, but after even the last step, the same error message appears:
The following packages have unmet dependencies: libudev-dev : Depends: libudev1 (= 252.38-1~deb12u1) but 254.26-1~bpo12+1 is to be installed E: Unable to correct problems, you have held broken packages.
Would you recommend sudo apt purge libudev1 libudev-dev libparted-dev followed by reinstalling?
I'm worried this could break my system....
Thanks again
I have since done: sudo apt-get install --reinstall libudev1 which was OK, then: sudo apt-get install --reinstall libudev-dev which gave: Reading package lists... Done Building dependency tree... Done 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: libudev1 (= 252.38-1~deb12u1) but 254.26-1~bpo12+1 is to be installed E: Unable to correct problems, you have held broken packages.
Without much hope, I tried sudo apt-get install --reinstall libparted-dev but the result was the same.
libudev1 (= 252.38-1~deb12u1) but 254.26-1~bpo12+1 is to be installed Looks as if libudev1 is an earlier version (252.38-1) that does not match libudev-dev (254.26-1) and libparted-dev