简体   繁体   English

如何使用工具链为 Linux 上的所有用户安装 rustup 和 cargo?

[英]How to install rustup and cargo with a toolchain for all users on Linux?

I am trying to install rustup with clippy, but I am looking way of installing for all users.我正在尝试使用 clippy 安装 rustup,但我正在寻找为所有用户安装的方法。

I installed rustup in /opt/setup.我在 /opt/setup 中安装了 rustup。 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 .如果我尝试安装工具链,它不需要/opt/setup而是/home/user I specified RUSTUP_HOME and CARGO_HOME in my .bashrc file but still it chooses /home/user .我在我的.bashrc文件中指定RUSTUP_HOMECARGO_HOME但它仍然选择/home/user Is there a way to achieve this?有没有办法做到这一点?

As of Apr 16, 2016 :截至2016 年 4 月 16 日

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.即使在 2017 年 9 月 10 日,该问题仍然存在,所以我不会等待它,因为使用 clippy 安装 Rust 很简单。

As suggested in the comments elsewhere, you can get your package manager to do it on some distributions.正如其他地方评论中所建议的那样,您可以让您的 package 经理在某些发行版上执行此操作。 sudo zypper install cargo landed what I needed with openSuse LEAP. sudo zypper install cargo使用 openSuse LEAP 获得了我需要的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM