How to fix could not find system library 'libudev' in Fedora 37
libudev is a package that provides a library for accessing information about devices managed by the udev system in the Linux kernel
Applications that need to access information about devices to manage them, such as for device hotplugging or power management, often use libudev
.
Other packages use the libudev
package to provide higher-level APIs for accessing and managing devices, such as libudev-dev
or libudev1-dev
.
In my case, I encountered this issue when installing a Rust package (spl-token-cli
):
--- stderr
thread 'main' panicked at 'Unable to find libudev: `"pkg-config" "--libs" "--cflags" "libudev"` did not exit successfully: exit status: 1
error: could not find system library 'libudev' required by the 'hidapi' crate
--- stderr
...and noted there was no libudev
, libudev-dev
or libudev1-dev
in DNF when trying to resolve the dependency.
Solution:
sudo dnf install libudev-devel