4

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

bertramscharpf
  • 175
  • 1
  • 10

1 Answers1

3

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
bertramscharpf
  • 175
  • 1
  • 10
  • First of all, thank you so much for this, the same issue was bugging me for a long time. Second, is it safe to delete the 'temporary target' afterwards? Cargo doesn't clean it autmatically, and it has 12.1 GiB in my case – aaglovatto Mar 01 '23 at 18:24