In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, Xiaobian will bring you about how to install Rust programming language in Linux system. The article is rich in content and analyzes and narrates from a professional point of view. After reading this article, I hope you can gain something.
Rust is a universal, multi-paradigm, modern, cross-platform, and open-source systems programming language sponsored by Mozilla Research. Rust is syntactically similar to C++, but Rust provides better memory security.
There are many ways to install Rust, but here are the official recommendations.
$ curl https://sh.rustup.rs-sSf| sh After typing the command console output: root@node_super:~# curl https://sh.rustup.rs -sSf| sh info: downloading installer Welcome to Rust! This will download and install the official compiler for the Rust programming language, and its package manager, Cargo. It will add the cargo, rustc, rustup and other commands to Cargo's bin directory, located at: /root/.cargo/bin This can be modified with the CARGO_HOME environment variable. Rustup metadata and toolchains will be installed into the Rustup home directory, located at: /root/.rustup This can be modified with the RUSTUP_HOME environment variable. This path will then be added to your PATH environment variable by modifying the profile file located at: /root/.profile You can uninstall at any time with rustup self uninstall and these changes will be reverted. Current installation options: default host triple: x86_64-unknown-linux-gnu default toolchain: stable profile: default modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation > info: profile set to 'default' info: default host triple is x86_64-unknown-linux-gnu info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' 463.3 KiB / 463.3 KiB (100 %) 94.6 KiB/s in 2s ETA: 0s info: latest update on 2020-03-12, rust version 1.42.0 (b8cedc004 2020-03-09) info: downloading component 'cargo' 4.8 MiB / 4.8 MiB (100 %) 707.4 KiB/s in 7s ETA: 0s info: downloading component 'clippy' 1.8 MiB / 1.8 MiB (100 %) 887.5 KiB/s in 3s ETA: 0s info: downloading component 'rust-docs' 12.0 MiB / 12.0 MiB (100 %) 1.6 MiB/s in 9s ETA: 0s info: downloading component 'rust-std' 17.1 MiB / 17.1 MiB (100 %) 2.5 MiB/s in 8s ETA: 0s info: downloading component 'rustc' 58.6 MiB / 58.6 MiB (100 %) 3.4 MiB/s in 20s ETA: 0s info: downloading component 'rustfmt' 3.0 MiB / 3.0 MiB (100 %) 2.9 MiB/s in 1s ETA: 0s info: installing component 'cargo' info: installing component 'clippy' info: installing component 'rust-docs' 12.0 MiB / 12.0 MiB (100 %) 7.0 MiB/s in 1s ETA: 0s info: installing component 'rust-std' 17.1 MiB / 17.1 MiB (100 %) 10.5 MiB/s in 1s ETA: 0s info: installing component 'rustc' 58.6 MiB / 58.6 MiB (100 %) 8.8 MiB/s in 6s ETA: 0s info: installing component 'rustfmt' info: default toolchain set to 'stable' stable installed - rustc 1.42.0 (b8cedc004 2020-03-09) Rust is installed now. Great! To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH environment variable. Next time you log in this will be done automatically. To configure your current shell run source $HOME/.cargo/env Run the following command to configure your current shell.
$ source $HOME/.cargo/env Run the following command to verify the installed version of Rust.
$ rustc --version
After installing Rust, please follow the steps below to check whether the Rust language works properly.
mkdir /home/rust/ cd /home/rust/ vim test.rs Write the following code
fn main() { println! ("Hello, welcome to come Rust! "); } Run the following command to compile rust code.
rustc test.rs The above command creates an executable Rust program in the same directory.
ls -lh
Run the Rust executable to get output.
./ test Hello, welcome to come Rust! Update Rust to the latest version.
rustup update Run the following command to remove the Rust package from the system.
Linux is a freely available and freely disseminated UNIX-like operating system, a POSIX-based multiuser, multitasking, multithreaded and multiCPU operating system that runs major Unix tools, applications, and network protocols.
The above is how to install the Rust programming language in the Linux system shared by everyone. If you happen to have similar doubts, you may wish to refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.