cargo-update: Checking and Applying Cargo Executable Updates
A cargo subcommand for checking and applying updates to installed executables
At a glance
- What is it?
- cargo-update is a Cargo subcommand for comparing installed executable crates with available versions and updating selected or installed packages. It offers bulk checks and per-crate build configuration, but native dependencies and registry setup add operational complexity.
- Who is it for?
- Developers who want a report of outdated Cargo-installed executables and explicit control over updating them may adopt cargo-update. Developers whose needs are covered by Cargo's built-in update check should avoid the additional native setup.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 87 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Why cargo-update Exists for Cargo Executables
cargo-update addresses the part of Rust package management that begins after `cargo install` has placed an executable in a developer's environment. Cargo can install a crate as a command, but knowing which installed executables have newer versions and applying updates consistently requires extra tooling. The project therefore presents itself as a Cargo subcommand rather than a separate application with an unrelated workflow.
It is aimed at developers who installed executables through Cargo and want either a complete inventory of updates or a targeted operation. The `-a` form checks all packages registered through Cargo installation. Supplying package names narrows the operation to selected crates and does not install packages that are absent. That distinction matters on shared build machines and development workstations where updating every executable could introduce unrelated changes.
The update mechanism still depends on Cargo and the crates.io registry rather than maintaining an independent package database. For a custom registry, the README states that cargo-update resolves source replacement to the deepest registry and passes `--registry sjtu` to `cargo install`. This registry handling also exposes a compatibility concern: the documentation records additional configuration required after changes in Cargo's registry behavior.
This project is not intended for ordinary Rust libraries consumed through `Cargo.toml`. It manages executables that were installed as command-line tools with `cargo install`, including developer utilities distributed as crates. A project migrated from crates.io to a `rustup` component can therefore appear in Cargo's installation metadata while no longer having a valid crates.io release path.
Command Flow from Inventory to Cargo Installation
The documented interface has two primary operational paths. `cargo install-update -a` checks for newer releases and updates every installed package eligible for that operation. A command containing explicit crate names follows the same general concept for selected packages, except it will not install missing crates.
Based on the repository layout, the executable is implemented in Rust under `src`, with command documentation under `man`, tests under `tests`, and fixtures under `test-data`. The README also links Rust API documentation for the crate and provides separate manuals for `cargo-install-update` and `cargo-install-update-config`. Those sources indicate that installation, update execution, and per-crate build configuration are treated as related but distinct concerns.
The actual crate compilation remains Cargo's responsibility. During an update, Cargo updates its registry and performs the build. The displayed output includes an `Updating crates.io index` step followed by `Installing` and `Compiling`, so cargo-update acts as the discovery and orchestration layer rather than as a replacement compiler or installer backend.
Configuration can alter how a selected crate is built. The documented `cargo install-update-config` example selects the unstable toolchain, enables `feature1`, and disables default features. This is a material difference from a simple version comparison. Build settings are attached to the update operation, allowing a crate's rebuild command to follow installation requirements without changing the user's global Cargo configuration.
The project also knows how it is represented in Cargo's installation metadata. Its Windows self-update procedure removes an older version, adds the current executable's extension to the renamed file, and creates an empty replacement so `cargo install` replaces the entry instead of adding a duplicate in `.crates.toml`. On Linux and Windows, the README states that cargo-update can update itself. It does not document the equivalent macOS procedure.
Installing cargo-update and Checking Installed Tools
Installation begins with CMake and the native libraries listed in the README. On Linux distributions, the documented dependency set includes `libgit2-dev`, development files for `libcurl`, `libssh2`, `openssl`, and sometimes `pkgconf`. Users should install the packages appropriate for their distribution before invoking Cargo.
Once those prerequisites are present, the primary installation command is:
cargo install cargo-updateThis installs the `cargo-update` package and makes its Cargo subcommands available to Cargo. The README does not give a separate executable-installation command because the project is consumed through Cargo.
The first useful operation is an all-package update check and application:
cargo install-update -aThe command is expected to inspect Cargo-installed executables, identify packages with newer available versions, and invoke the update process. If a crate cannot be updated, the terminal output may still provide a package table, registry progress, installation output, and a compiler or build-script error.
For a narrower first use, substitute explicit package names:
cargo install-update crate1 crate2 ...The literal names in this example are placeholders from the README rather than packages known to be installed. cargo-update should only consider those selected packages, and it will not install them if they are missing.
Platforms where native dependency discovery fails have several documented alternatives. They include changing `PKG_CONFIG_PATH`, setting `LIBSSH2_SYS_USE_PKG_CONFIG=whatever`, configuring OpenSSL paths, or asking Cargo to use vendored versions of OpenSSL, libgit2, or libcurl. These are troubleshooting paths, not part of the normal install sequence.
OpenSSL, pkg-config, and Other Native Build Constraints
The main adoption cost is the build environment required by cargo-update's native dependencies. The standard `cargo install cargo-update` command is short, but it is not dependency-free. CMake must be installed first, and the native development libraries must be discoverable by Cargo's build scripts.
The README lists platform-specific package names for Debian, Fedora, and MSYS2. On non-Apple Unix systems, `libsecret` is optional and is dynamically loaded as `libsecret-1.so.0`. Apple systems therefore differ in the listed dependency set. The documentation also states that `pkgconf` is required on some platforms, making pkg-config behavior part of installation compatibility rather than an incidental detail.
If automatic linking fails, the documented retry with a vendored OpenSSL feature is:
One documented workaround is to re-try with `--features vendored-openssl`.
Vendored variants are also available for libgit2 and libcurl. Their feature names are `vendored-libgit2` and `vendored-libcurl`. The README does not present these as required defaults, so switching to them changes the build strategy for native components and may involve a different compilation path.
A Homebrew-specific OpenSSL path is documented as an environment-based retry:
LDFLAGS="-L/usr/local/opt/[email protected]/lib" CPPFLAGS="-I/usr/local/opt/[email protected]/include"The environment assignment itself does not install cargo-update, so it must be applied in the command environment used for the installation attempt. The README also advises checking for duplicate OpenSSL installations when using Homebrew. These constraints make CI images, containers, and cross-platform workstations more involved than a pure Rust command would be.
Package discovery also depends on how the host system exposes native libraries. A successful installation on one machine does not establish that the same command will work in a minimal container or a different distribution. The documented package table is therefore part of the first-use procedure, not merely background information.
Registry Replacement and Rustup Migration Boundaries
Cargo-update has to respect the registry selected by Cargo, and this is where its behavior becomes more specialized. The README gives a source-replacement example in `~/.cargo/config` that redirects crates.io to the Shanghai Jiao Tong University mirror. For this configuration, cargo-update resolves the deepest registry and passes the corresponding registry selection to Cargo.
The documentation records that some Cargo versions require a second registry entry. The additional stanza is:
[registries.sjtu]
index = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"This is not cosmetic. The README says the behavior worked with older nightly Cargo versions but broke after a Cargo registry-key change. Users who use source replacement should therefore treat their Cargo version and registry definitions as part of cargo-update's operating requirements.
There is a separate compatibility boundary involving tools distributed through `rustup`. The README identifies `clippy` and `rustfmt` as examples of crates that moved from crates.io to rustup components. If old Cargo installations remain recorded after the tools were added through rustup, an update attempt can still select the obsolete crates.io package. The documented error reports that Clippy is no longer available via crates.io and points users toward `rustup component add clippy-preview`.
The cleanup path begins by checking Cargo's registered installations:
cargo install --listThe README says to use `cargo uninstall` to remove stale Cargo entries after confirming the problem. This is a real failure mode because installation metadata can outlive the distribution model that originally created an executable. A newer package version is not necessarily an applicable upgrade if the executable has migrated to another provider.
cargo-update Compared with Cargo's Built-in Update Check
The closest alternative is Cargo itself. Since Cargo 0.42.0, `cargo install cratename` checks for newer versions and installs them when they exist. That built-in path covers the basic need to refresh one known executable without installing cargo-update and its native dependencies.
cargo-update differs by operating across the installed set. Its `-a` option checks every Cargo-installed package, which is useful for periodic maintenance or for seeing a wider inventory of outdated tools. It also provides a separate configuration command for controlling toolchain, features, and default-feature use during a crate build. The documented self-update behavior on Linux and Windows adds another distinction, although the README does not document self-update on macOS.
The cost of that additional control is a larger compatibility surface. cargo-update interacts with registry replacement, Cargo metadata, native Git and HTTP libraries, OpenSSL, pkg-config, toolchain selection, and potentially stale entries left by rustup migrations. Cargo's own install path avoids the requirement to compile this additional subcommand, although any underlying native dependencies used by the crate being installed can still affect that build.
For a developer with one executable and no need for bulk reports or cargo-update-specific build settings, Cargo's built-in behavior is the simpler choice. For a workstation with several executables installed through Cargo, especially one using source replacement, cargo-update offers more explicit control but demands closer attention to registry and native-library configuration.
The choice should therefore follow the required scope. Bulk inspection and update orchestration favor cargo-update. A single known executable with ordinary Cargo installation favors the built-in command. Both approaches still compile the target crate, so the project's additional tooling does not remove normal Rust build requirements.
Release Cadence, MIT Terms, and Upgrade Work
The repository is not archived, and its last push was on 2026-07-27. Version 22.1.1 was released on 2026-07-28, following v22.1.0 on 2026-07-21 and v22.0.0 on 2026-07-12. This release history shows recent project changes, although it does not by itself define the cost or risk of each upgrade.
The package metadata declares the MIT license, and the repository contains a `LICENSE` file. That means the project is distributed under a permissive open source license, but license interpretation and compliance obligations should be evaluated from the actual license text rather than inferred solely from the identifier. The license applies to this project; it does not automatically settle questions involving separately distributed Rust crates or native libraries installed by Cargo.
Upgrading cargo-update is performed through Cargo installation, so users should account for rebuilding Rust and native components rather than assuming a drop-in replacement. The documented source-replacement caveats show that compatibility can depend on the Cargo version in use. Likewise, the troubleshooting paths for OpenSSL and pkg-config suggest that an upgrade can expose build-environment differences even when normal installation previously succeeded.
The repository includes manual sources under `man`, Rust API documentation is linked from the README, and tests are separated under `tests`. These are concrete places to inspect when planning an upgrade, especially if the installed Cargo version or registry configuration differs from the environment described by the project. An upgrade should first check the registry keys and native libraries used by the existing installation, then proceed through `cargo install cargo-update` only after those prerequisites are available.
Editorial conclusion
Developers who want a report of outdated Cargo-installed executables and explicit control over updating them may adopt cargo-update. Developers whose needs are covered by Cargo's built-in update check should avoid the additional native setup. Before adoption, verify that CMake and the required development libraries are available, then confirm that any custom source replacement includes the registry keys expected by the installed Cargo version.
Frequently asked questions
What does cargo-update do?
It is a Cargo subcommand for checking newer versions of installed executables and applying updates. It can process all installed packages or a selected set, but selected-package mode will not install a missing crate.
How do I install cargo-update?
Install CMake and the required native libraries first, then run `cargo install cargo-update`. The native dependency list includes libgit2, libcurl, libssh2, OpenSSL, and, on some platforms, pkgconf.
Does cargo-update work with a custom Cargo registry?
The README describes source-replacement handling and states that cargo-update resolves the deepest registry before passing `--registry sjtu` to `cargo install`. It also documents an additional `[registries.sjtu]` entry for affected Cargo versions.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/nabijaczleweli-cargo-update)Was this useful?