How To Install rustc on Ubuntu 20.04

In this tutorial we learn how to install rustc on Ubuntu 20.04. rustc is Rust systems programming language Rust systems programming language

Introduction

In this tutorial we learn how to install rustc on Ubuntu 20.04.

What is rustc

rustc is:

Rust is a curly-brace, block-structured expression language. It visually resembles the C language family, but differs significantly in syntactic and semantic details. Its design is oriented toward concerns of “programming in the large”, that is, of creating and maintaining boundaries - both abstract and operational - that preserve large-system integrity, availability and concurrency.

It supports a mixture of imperative procedural, concurrent actor, object-oriented and pure functional styles. Rust also supports generic programming and meta-programming, in both static and dynamic styles.

Package: rustc Architecture: amd64 Version: 1.41.0+dfsg1+llvm-0ubuntu2 Multi-Arch: allowed Priority: extra Section: universe/devel Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian Rust Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 5069 Depends: libc6 (>= 2.14), libgcc-s1 (>= 3.0), libstd-rust-dev (= 1.41.0+dfsg1+llvm-0ubuntu2), gcc, libc-dev, binutils (>= 2.26) Recommends: cargo (>= 0.42.0~~), cargo (« 0.43.0~~), rust-gdb | rust-lldb Suggests: rust-doc, rust-src, lld-9 Breaks: libstd-rust-dev (« 1.26.2+dfsg1+llvm-0ubuntu1~~) Replaces: libstd-rust-dev (« 1.26.2+dfsg1+llvm-0ubuntu1~~) Filename: pool/universe/r/rustc/rustc_1.41.0+dfsg1+llvm-0ubuntu2_amd64.deb Size: 1733868 MD5sum: b468f9ebcd62782e86cc3aae5a8628f2 SHA1: 18eaec87bf90b909d95b81f4d5fc43802ef283af SHA256: fc0581d7870dfabb3e6e8fe3c22ebc7f7ba40a08500d0e1533bbbd5b06ec190b Homepage: http://www.rust-lang.org/ Description-en: Rust systems programming language Rust is a curly-brace, block-structured expression language. It visually resembles the C language family, but differs significantly in syntactic and semantic details. Its design is oriented toward concerns of “programming in the large”, that is, of creating and maintaining boundaries - both abstract and operational - that preserve large-system integrity, availability and concurrency.

It supports a mixture of imperative procedural, concurrent actor, object-oriented and pure functional styles. Rust also supports generic programming and meta-programming, in both static and dynamic styles.

There are three methods to install rustc on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install rustc Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install rustc using apt-get by running the following command:

sudo apt-get -y install rustc

Install rustc Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install rustc using apt by running the following command:

sudo apt -y install rustc

Install rustc Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install rustc using aptitude by running the following command:

sudo aptitude -y install rustc

How To Uninstall rustc on Ubuntu 20.04

To uninstall only the rustc package we can use the following command:

sudo apt-get remove rustc

Uninstall rustc And Its Dependencies

To uninstall rustc and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove rustc

Remove rustc Configurations and Data

To remove rustc configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge rustc

Remove rustc configuration, data, and all of its dependencies

We can use the following command to remove rustc configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge rustc

References

Summary

In this tutorial we learn how to install rustc package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.