cargo install: specify a /tmp substitute?

Viewed 547

cargo install says:

error: failed to write /tmp/rustcaq37XH/lib.rmeta: No space left on device (os error 28)

Therefore I would like to tell Cargo to use some other directory than /tmp. As far as I can see, there is no environment variable or configuration option to set that. What can I do?

Thanks in advance,

Bertram

1 Answers

The key to the soulution is the term "temporary target". As the documentation says, you can point that to a relative directory.

cd ~/.cargo
mkdir tmp
CARGO_TARGET_DIR=tmp cargo install mdbook
Related