Search code examples
linuxrustdebianrust-cargo

How to make cargo use another path to compile instead of /tmp (No space left on device (os error 28))


I'm on Debian 11 with a LUKS encrypted SSD, my /tmp, /var and /home folders are in separated partitions (I don't know why I did this when Installing it)

I tried installing deno using cargo and it throws me this error No space left on device (os error 28) which is due to my /tmp partition being full (it's only 1.7GB)

I've tried changing the $CARGO_TARGET_DIR variable, $TMPDIR variable and linking another folder with the same name as the folder cargo was using to build (cargo-installA5Ssau at that time) and none worked

Is there a way I can make cargo use another directory other than /tmp or increase the size of /tmp (this one is my second choice as I guess it'll be harder)?


Solution

  • cargo install has a --target-dir option now.