【发布时间】:2018-11-08 05:42:16
【问题描述】:
我正在运行 WSL Debian 发行版,因为我想学习 InterMezzOS 教程。我按照 Rust 的安装说明运行了curl https://sh.rustup.rs -sSf | sh,但我只能通过在运行source $HOME/.cargo/env 之后运行source $HOME/.cargo/env 来使rustc 命令可用,并且当我退出sudo 时我不能调用它,并且当我重新输入sudo su 时,它不再起作用了,我必须再次输入。
有什么方法可以让它在我每次打开 shell 时都能正常工作,而不是每次都运行 sudo?
【问题讨论】:
-
在运行
sudo su之后——为什么?如果不使用sudo会怎样? -
@Shepmaster 它说“没有这样的文件或目录”。我试过做
chown,它说的是同样的事情。我也必须安装 Rust 做sudo,除非我添加一个“-y”标志,否则它不会让我这样做,我无法弄清楚如何工作。这是问题的一部分吗? -
为什么要使用 sudo? rustc、cargo、rustup 和 rustdoc 都不需要 root。实际上在编译时使用 root 是很危险的。 (至少在 C 世界中,不确定 Rust)
-
@hellow 当我尝试使用
curl https://sh.rustup.rs -sSf | sh:error: $HOME differs from euid-obtained home directory: you may be using sudo error: if this is what you want, restart the installation with-y'` 安装时,它给了我这个错误。我将 bash 设置为自动在我的 Windows 文件夹中打开,这是问题的一部分吗?
标签: bash rust debian sudo windows-subsystem-for-linux