ERROR: cargo install spl-token-cli

Hi everyone,

This is the error I am getting during the installation of cargo. Could you help me with this?

error: failed to run custom build command for hidapi v1.3.3

Caused by:
process didn’t exit successfully: /tmp/cargo-installvsU5np/release/build/hidapi-5ac2e8ad75cd8050/build-script-build (exit status: 101)
— stdout
cargo:rerun-if-env-changed=LIBUDEV_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=LIBUDEV_STATIC
cargo:rerun-if-env-changed=LIBUDEV_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

— 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
Package libudev was not found in the pkg-config search path.
Perhaps you should add the directory containing libudev.pc' to the PKG_CONFIG_PATH environment variable No package 'libudev' found ', /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/hidapi-1.3.3/build.rs:55:54 note: run with RUST_BACKTRACE=1environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: failed to compilespl-token-cli v2.0.15, intermediate artifacts can be found at /tmp/cargo-installvsU5np`

Caused by:
build failed

1 Like

Make sure you have libudev-dev package installed. Run the following commands:
sudo apt update and then sudo apt install libudev-dev
If the error persists, check that your paths are well configured. But, most likely your issue will be with the installation of the libudev-dev package. Happy coding.

Thank you very much, appreciated.