Aryan Bagade
Aryan Bagade

Reputation: 39

Getting "error: could not amend shell profile: Permission denied" installing rustup using recommended command

I tried installing Rust using the below command, which is recommended by https://rustup.rs/ for Unixes:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

but getting an error

error: could not amend shell profile: '/Users/XXXX/.bash_profile'
       could not write rcfile file: '/Users/XXXX/.bash_profile'
       Permission denied (os error 13)

However, I am using zsh not bash.

Upvotes: 3

Views: 3832

Answers (1)

Cornelius Roemer
Cornelius Roemer

Reputation: 8148

Your home directory seems to not be editable which crashes the installer.

There seems to be a fix for this discussed in a rustup repo issue. Append -s -- -y --no-modify-path to bash:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
bash -s -- -y --no-modify-path

Alternatively, you could give write permission to the path that couldn't be edited, or run this command with sudo.

Upvotes: 9

Related Questions