How to clear the Cargo cache?
Solution 1
I believe that manifest
file is just for the built-in libraries, i.e. those distributed with rustc
. cargo
itself stores things in ~/.cargo
(for the moment), if you do wish to just remove all the libraries then deleting that directory won't break anything.
If you're just wanting cargo
to rebuild/update dependencies you can run cargo update
.
Solution 2
Install and run cargo-cache to clear the cache in the ~/.cargo
folder:
$ cargo install cargo-cache
$ cargo cache -a
Related videos on Youtube
Comments
-
bojangle over 2 years
When I run
cargo build
, various libs get stored within the folder/usr/local/lib/rustlib/
.What is the correct way to clear these libs? I could
rm
these files manually, but would that be the right thing to do? I noticed that/usr/local/lib/rustlib/manifest
is a file containing a list of the fill file paths of all the libs, and hence might be breaking something if I remove these files manually. -
bojangle almost 10 yearsThanks for pointing me to
~/.cargo
, that is what I was looking for! -
DenisKolodin over 3 yearskeep the
bin
folder if you don't want to reinstall all that cool Rust tools you've installed ) -
Mathieu CAROFF over 2 yearserror caused by "feature
resolver
is required" :sad_face: -
chovy about 2 yearserror: no such subcommand:
cache
-
Michael Mc Donnell about 2 years@chovy did you remember to install cargo-cache first?
-
Matthew Strawbridge about 2 yearsIn particular, by default this will remove the
cargo
executable itself too.