Imaxd
Imaxd

Reputation: 366

How can I remove rust cargo from my PATH after installing rust

I have ~/.cargo/bin in $PATH since I installed rust and cargo using curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh. I can't find where .cargo/bin is added to my PATH anywhere (my default shell is zsh). I want to remove it from my PATH.

Upvotes: 2

Views: 1155

Answers (1)

Thomas
Thomas

Reputation: 899

I struggled with the same issue for months until I finally found what was going on. Cargo is automatically added to your path in the ~/.zprofile file (~/.profile for Bash users), with the line export PATH="$HOME/.cargo/bin:$PATH". Removing this line fixes the issue.

I hope this helps whoever was searching for this answer because I didn't find one anywhere. 🙂

Upvotes: 3

Related Questions