How to install rustup and cargo with a toolchain for all users on Linux?
Asked Answered
R

2

7

I am trying to install rustup with clippy, but I am looking way of installing for all users.

I installed rustup in /opt/setup. Whenever I switch users, I get this:

error: no default toolchain configured

If I try to install a toolchain it does not take /opt/setup but /home/user. I specified RUSTUP_HOME and CARGO_HOME in my .bashrc file but still it chooses /home/user. Is there a way to achieve this?

Recor answered 5/6, 2018 at 7:17 Comment(0)
R
3

As of Apr 16, 2016:

It does not support it now

Even in Sept 10, 2017 the issue is still open, so I'd not wait for it, since installing Rust with clippy is straight forward.

Rebekahrebekkah answered 5/6, 2018 at 7:40 Comment(3)
Is it still not supported in 2019?Recor
It is still open in 2020 NovemberRaisin
I for one don't think this should get closed. Neither cargo nor rustup are system package managers and they shouldn't meddle with things outside their scope. Lots of distros have packages for rust toolchains and clippy. If your system doesn't talk to the distro package managers. If you want rustup to manage executing some things in your user space that's fine, but don't expect it to take over the system. There are so many pitfalls to ding that it's just not meant to cover. NPM and friends should never have tried to go down that road.Gullah
K
0

As suggested in the comments elsewhere, you can get your package manager to do it on some distributions. sudo zypper install cargo landed what I needed with openSuse LEAP.

Knurled answered 26/1, 2023 at 22:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.