简体   繁体   English

如何手动安装和卸载 Rust?

[英]How to manually install and uninstall Rust?

I'd like to try on a "hello world" program on Rust.我想在 Rust 上尝试一个“hello world”程序。 I didn't choose rustup for auto-installation but downloaded the standalone installer .我没有选择rustup进行自动安装,而是下载了独立安装程序 I thought I could follow the classic way to manually install it on Linux platform bundled with GCC and Clang below,我以为我可以按照经典的方式将它手动安装在 Linux 平台上,下面捆绑了 GCC 和 Clang,

$ tar xf rust-xxx.tar.gz; mv rust-xxx $RUST_HOME 
$ cd /usr/local/bin; sudo ln -s $RUST_HOME/bin/rustc
$ rustc hello.rs; ./hello

However I found install.sh inside, so I have to run it for the installation, don't I?但是我在里面找到了install.sh ,所以我必须运行它来安装,不是吗? How to completely uninstall it afterwards?之后如何完全卸载它?

I just downloaded the archive you linked and had a look inside the installation script.我刚刚下载了您链接的存档并查看了安装脚本。

During installation it will create an uninstall.sh script and actually print out for you the location:在安装期间,它将创建一个uninstall.sh脚本并实际为您打印出位置:

install_uninstaller() {
    local _src_dir="$1"
    local _src_basename="$2"
    local _abs_libdir="$3"

    local _uninstaller="$_abs_libdir/$TEMPLATE_REL_MANIFEST_DIR/uninstall.sh"
    msg "creating uninstall script at $_uninstaller"
    run cp "$_src_dir/$_src_basename" "$_uninstaller"
    critical_need_ok "unable to install uninstaller"
}

#...


# Install the uninstaller
install_uninstaller "$src_dir" "$src_basename" "$abs_libdir"

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

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