Does cargo install have an equivalent update comma

2019-01-23 00:48发布

问题:

I'd like to update a package that I used cargo install to globally install packages, such as rustfmt or racer. I can't find a way to update an installed package without first deleting it (via cargo uninstall) and then running the install command again. Is there an update command?

回答1:

There is no such command in vanilla cargo (well, there's cargo install but that's for dependencies), but since cargo supports third-party subcommands there is an answer: the cargo-update crate.

Install as usual with cargo install cargo-update, then use cargo install-update -a to update all installed packages, for more usage information and examples see the cargo install-update manpage.

Disclaimer: am author



回答2:

A solution I've found is to add the --force flag to the install command. For example cargo install --force clippy. This will effectively re-install the latest version.



回答3:

Nope. You can discuss it in this issue.



回答4:

The command to update dependencies is cargo update

Source : http://doc.crates.io/guide.html