Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

rust

rustup

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.

like image 357
Aryan Bagade Avatar asked Dec 10 '25 21:12

Aryan Bagade


1 Answers

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.

like image 74
Cornelius Roemer Avatar answered Dec 13 '25 15:12

Cornelius Roemer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!