{"id":309,"hash":"8f5bbf6841868e865cf2a4cf609e4c09cc3808318178beab97f216249ce8192a","pattern":"Error installing a crate via cargo: specified package has no binaries","full_message":"I'm trying to install a Rust crate on my system (Arch Linux) using Cargo. I can search for crates and find what I need, for example:\n\n $ cargo search curl | head -n3\n    Updating registry `https://github.com/rust-lang/crates.io-index`\ncurl (0.3.0)             Rust bindings to libcurl for making HTTP requests\ncurl-sys (0.2.0)         Native bindings to the libcurl library\n\nWhen I try to install it, I get the following error:\n\n $ cargo install curl\n    Updating registry `https://github.com/rust-lang/crates.io-index`\nerror: specified package has no binaries\n\nWhat does this mean? Do I have to build it from source first? What's the point of Cargo if it does not install it in the first place?\n\n $ uname -a\nLinux 4.6.1-2-ARCH #1 SMP PREEMPT Thu Jun 2 15:46:17 CEST 2016 x86_64 GNU/Linux\n $ rustc --version\nrustc 1.9.0\n $ cargo --version\ncargo 0.10.0 (10ddd7d 2016-04-08)","ecosystem":"cargo","package_name":"installation","package_version":null,"solution":"cargo install is used to install binary packages that happen to be distributed through crates.io.\n\nIf you want to use a crate as a dependency, add it to your Cargo.toml.\n\nRead the Rust getting started guide and the Cargo getting started guide for further information. In short:\n\ncargo new my_project\ncd my_project\necho 'curl = \"0.3.0\"' >> Cargo.toml\n\nAmusingly, you can install a third-party Cargo subcommand called cargo-edit using cargo install that makes it easier to modify your Cargo.toml file to add and remove dependencies!\n\ncargo install cargo-edit\ncargo add curl\ncargo rm curl\n\nAn important thing to note is that every Cargo project manages and compiles a separate set of dependencies (some background info). Thus it doesn't make sense to install a compiled library. The source code for each version of a library will be cached locally, avoiding downloading it multiple times.\n\nSee also:\n\ncargo install <library_name> --library (Cargo issue #2552)\ncargo-add documentation (added to Cargo directly in 1.62.0)","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/37706999/error-installing-a-crate-via-cargo-specified-package-has-no-binaries","votes":49,"created_at":"2026-04-19T04:41:50.436666+00:00","updated_at":"2026-04-19T04:52:30.365808+00:00"}