How To Install cargo-doc on Ubuntu 20.04

In this tutorial we learn how to install cargo-doc on Ubuntu 20.04. cargo-doc is Rust package manager, documentation Rust package manager, documentation Rust package manager, documentation

Introduction

In this tutorial we learn how to install cargo-doc on Ubuntu 20.04.

What is cargo-doc

cargo-doc is:

Cargo is a tool that allows Rust projects to declare their various dependencies, and ensure that you’ll always get a repeatable build.

To accomplish this goal, Cargo does four things:

  • Introduces two metadata files with various bits of project information.
  • Fetches and builds your project’s dependencies.
  • Invokes rustc or another build tool with the correct parameters to build your project.
  • Introduces conventions, making working with Rust projects easier.

Cargo downloads your Rust project’s dependencies and compiles your project.

This package contains the documentation.

Package: cargo-doc Architecture: all Version: 0.44.1-0ubuntu1~20.04.1 Priority: extra Section: universe/doc Source: cargo Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Rust Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 17137 Filename: pool/universe/c/cargo/cargo-doc_0.44.1-0ubuntu1~20.04.1_all.deb Size: 1180976 MD5sum: 4388967e76b2faf9b6735e2adab59542 SHA1: 6d91de3b59adab4cd1fd2242c97e4d79a240e6ab SHA256: 2e1a73cc4276f17845f211758c33aa6447104a55a94d56d21ffb38839e0075b3 SHA512: 0c54f63794ca55e6cf7d110f2e276ead12731c096b88267b9143074236536f57afdb05bb79865a24b718af99e071195854cb903cf4e066108c159308965a6eac Homepage: https://crates.io/ Description-en: Rust package manager, documentation Cargo is a tool that allows Rust projects to declare their various dependencies, and ensure that you’ll always get a repeatable build.

To accomplish this goal, Cargo does four things:

  • Introduces two metadata files with various bits of project information.
  • Fetches and builds your project’s dependencies.
  • Invokes rustc or another build tool with the correct parameters to build your project.
  • Introduces conventions, making working with Rust projects easier.

Cargo downloads your Rust project’s dependencies and compiles your project.

This package contains the documentation.

Package: cargo-doc Architecture: all Version: 0.42.0-0ubuntu1 Priority: extra Section: universe/doc Source: cargo Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Rust Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 19662 Filename: pool/universe/c/cargo/cargo-doc_0.42.0-0ubuntu1_all.deb Size: 1241800 MD5sum: 8988443556f17d029345ce397fed0fa6 SHA1: 5e4e8b8f1b4786b0fbb8a958287866d54903ac65 SHA256: eb492477a5245c356f6a1da6c0ae5ede4b783f972ce4c2a60a63b85557966e14 Homepage: https://crates.io/ Description-en: Rust package manager, documentation Cargo is a tool that allows Rust projects to declare their various dependencies, and ensure that you’ll always get a repeatable build.

To accomplish this goal, Cargo does four things:

  • Introduces two metadata files with various bits of project information.
  • Fetches and builds your project’s dependencies.
  • Invokes rustc or another build tool with the correct parameters to build your project.
  • Introduces conventions, making working with Rust projects easier.

Cargo downloads your Rust project’s dependencies and compiles your project.

This package contains the documentation.

There are three methods to install cargo-doc 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 cargo-doc Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install cargo-doc

Install cargo-doc Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install cargo-doc

Install cargo-doc 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 cargo-doc using aptitude by running the following command:

sudo aptitude -y install cargo-doc

How To Uninstall cargo-doc on Ubuntu 20.04

To uninstall only the cargo-doc package we can use the following command:

sudo apt-get remove cargo-doc

Uninstall cargo-doc And Its Dependencies

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

sudo apt-get -y autoremove cargo-doc

Remove cargo-doc Configurations and Data

To remove cargo-doc configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge cargo-doc

Remove cargo-doc configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge cargo-doc

References

Summary

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