I am following the course of Solana Blockchain developer with JavaScript and Rust. I am installing all the necessary frameworks and files. While installing anchor-cli using Cargo. I am getting the following error.
error: failed to run custom build command for hidapi v1.3.4
Caused by:
process didn't exit successfully: /tmp/cargo-installBgqF19/release/build/hidapi-8cca28feeebdc649/build-script-build
(exit status: 101)
--- stdout
cargo:rerun-if-env-changed=LIBUDEV_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_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_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_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_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_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_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_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 ', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hidapi-1.3.4/build.rs:57:54 note: run with
RUST_BACKTRACE=1environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: failed to compile
anchor-cli v0.24.2 (https://github.com/project-serum/anchor?tag=v0.24.2#0b4c7b0c), intermediate artifacts can be found at
/tmp/cargo-installBgqF19`
Caused by:
build failed