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