Rustup init fail on: `error: failed to extract package (perhaps you ran out of disk space?) `

Hi Rustaceans,

I have an issue when I try to set up rustup on Ubuntu 22.04;

zazbone@PC:~$ rm -r .cargo
zazbone@PC:~$ export CARGO_HOME=$HOME/.cargo
zazbone@PC:~$ export RUSTUP_HOME=$HOME/.cargo
zazbone@PC:~$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -v -y
info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
verbose: creating update-hash directory: '/home/zazbone/.cargo/update-hashes'
verbose: installing toolchain 'stable-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/home/zazbone/.cargo/toolchains/stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
verbose: creating temp root: /home/zazbone/.cargo/tmp
verbose: creating temp file: /home/zazbone/.cargo/tmp/yjjbjz9e9_8mnulk_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
verbose: deleted temp file: /home/zazbone/.cargo/tmp/yjjbjz9e9_8mnulk_file
verbose: no update hash at: '/home/zazbone/.cargo/update-hashes/stable-x86_64-unknown-linux-gnu'
verbose: creating temp file: /home/zazbone/.cargo/tmp/2fkx0jhyu4yb7sg6_file.toml
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml'
verbose: downloading with reqwest
verbose: checksum passed
verbose: creating temp file: /home/zazbone/.cargo/tmp/qnwx08vmrvpgqtj1_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.asc'
verbose: downloading with reqwest
verbose: deleted temp file: /home/zazbone/.cargo/tmp/qnwx08vmrvpgqtj1_file
verbose: Good signature from on https://static.rust-lang.org/dist/channel-rust-stable.toml from:
verbose: from builtin Rust release key
verbose:   RSAEncryptSign/85AB96E6-FA1BE5FE - Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
verbose:   Fingerprint: 108F 6620 5EAE B0AA A8DD 5E1C 85AB 96E6 FA1B E5FE
verbose: deleted temp file: /home/zazbone/.cargo/tmp/2fkx0jhyu4yb7sg6_file.toml
info: latest update on 2023-02-09, rust version 1.67.1 (d5a82bbd2 2023-02-07)
info: downloading component 'cargo'
verbose: creating Download Directory directory: '/home/zazbone/.cargo/downloads'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2023-02-09/cargo-1.67.1-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with reqwest
verbose: checksum passed
info: downloading component 'clippy'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2023-02-09/clippy-1.67.1-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with reqwest
verbose: checksum passed
info: downloading component 'rust-docs'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2023-02-09/rust-docs-1.67.1-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with reqwest
 19.3 MiB /  19.3 MiB (100 %)  11.2 MiB/s in  2s ETA:  0s
verbose: checksum passed
info: downloading component 'rust-std'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2023-02-09/rust-std-1.67.1-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with reqwest
 29.3 MiB /  29.3 MiB (100 %)  11.2 MiB/s in  7s ETA:  0s
verbose: checksum passed
info: downloading component 'rustc'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2023-02-09/rustc-1.67.1-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with reqwest
 67.8 MiB /  67.8 MiB (100 %)  11.2 MiB/s in  6s ETA:  0s
verbose: checksum passed
info: downloading component 'rustfmt'
verbose: downloading file from: 'https://static.rust-lang.org/dist/2023-02-09/rustfmt-1.67.1-x86_64-unknown-linux-gnu.tar.xz'
verbose: downloading with reqwest
verbose: checksum passed
info: installing component 'cargo'
verbose: creating temp directory: /home/zazbone/.cargo/tmp/oj50js6f4hk9bmqc_dir
verbose: deleted temp directory: /home/zazbone/.cargo/tmp/oj50js6f4hk9bmqc_dir
info: installing component 'clippy'
verbose: creating temp directory: /home/zazbone/.cargo/tmp/nyut5f14z_ku0cxu_dir
verbose: creating temp file: /home/zazbone/.cargo/tmp/ay5g30fc02z7scah_file
verbose: creating temp file: /home/zazbone/.cargo/tmp/vlhd6bfkydf4onxf_file
verbose: deleted temp directory: /home/zazbone/.cargo/tmp/nyut5f14z_ku0cxu_dir
info: installing component 'rust-docs'
verbose: creating temp directory: /home/zazbone/.cargo/tmp/jf_n8ot0h_dxzbxk_dir
 15.0 MiB /  19.3 MiB ( 78 %)   2.0 MiB/s in  1m 19s ETA:  2s
verbose: deleted temp directory: /home/zazbone/.cargo/tmp/jf_n8ot0h_dxzbxk_dir
info: rolling back changes
verbose: removing toolchain directory: '/home/zazbone/.cargo/toolchains/stable-x86_64-unknown-linux-gnu'
error: failed to extract package (perhaps you ran out of disk space?)

Caused by:
    Operation not permitted (os error 1)
sh: 466: rm: Operation not permitted
sh: 466: rmdir: Operation not permitted

Cargo, rustup and TMP dir are set manually because the first time I have tried to set up rustup it tried to write in root dir. I don't understand why it failed there, I'm pretty sure that I have enough disk space (~300 GB).

I will share with you any information that may be useful for you, thanks

Greetings

Can you check the file permissions of ~/.cargo, ~/.cargo/toolchains/ and ~/.cargo/toolchains/stable-x86_64-unknown-linux-gnu? By the way RUSTUP_HOME is normally ~/.rustup, not ~/.cargo. I'm not sure if rustup and cargo are fine with sharing a directory.

1 Like

Hi,

I've change RUSTUP_HOME just in case.
For all folders .cargo/, .rustup/ and .rustup/toolchains/ the user permissions are {read write execute} and for other {read, execute}
Toolchains cannot be installed, even if I try with the partially installed rustup.

querlioz@lappc-p712:~$ rustup default stable
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2023-02-09, rust version 1.67.1 (d5a82bbd2 2023-02-07)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 14.9 MiB /  19.3 MiB ( 77 %)   2.9 MiB/s in  4s ETA:  1s
info: rolling back changes
error: failed to extract package (perhaps you ran out of disk space?): Operation not permitted (os error 1)

Could you do strace to find the syscall that returns EPERM? For example using strace -Z rustup default stable |& grep EPERM?

Hi,

There is no match for EPERM in the strace, the full trace is too long for a copy and paste.

Sorry for the late responses

Maybe open an issue on GitHub - rust-lang/rustup: The Rust toolchain installer. Even if this is not the fault of rustup, the error message can be improved a lot.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.