Jul 4, 2023 4 min read

How to Install Anaconda in Ubuntu 22.04

Install Anaconda on Ubuntu 22.04 with our step-by-step tutorial. It's a powerful, open-source distribution of Python and R programming languages.

 Install Anaconda in Ubuntu 22.04
Table of Contents

Choose a different version or distribution

Introduction

Before we begin talking about how to install Anaconda in Ubuntu 22.04, let's briefly understand – What is Anaconda?

Anaconda is a powerful, open-source distribution of Python and R programming languages. It simplifies the process of installing and managing data science packages, making it ideal for beginners and experts alike. With Anaconda, you can easily create virtual environments, install libraries, and run code efficiently.

It comes preloaded with essential tools for data analysis, machine learning, and scientific computing, making it a go-to choice for data scientists. Whether you're a student, researcher, or professional, Anaconda provides a comprehensive platform for data-driven exploration and development.

In this tutorial, you will install Anaconda in Ubuntu 22.04. We will also address a few FAQs on how to install Anaconda on Ubuntu 22.04.

Advantages of Anaconda

  1. Simplified Package Management: Anaconda streamlines the installation and management of data science packages, saving time and effort.
  2. Powerful Virtual Environments: It allows the creation of isolated environments for different projects, ensuring package compatibility and reproducibility.
  3. Pre-installed Essential Tools: Anaconda comes bundled with popular libraries for data analysis, machine learning, and scientific computing.
  4. Cross-Platform Compatibility: It supports multiple operating systems, including Windows, macOS, and Linux, making it accessible to a wide range of users.
  5. Thriving Data Science Ecosystem: Anaconda is supported by a vibrant community and offers extensive documentation and resources, facilitating learning and collaboration.

Steps to Install Anaconda on Ubuntu 22.04

Anaconda packages are not included by default in Ubuntu. However, the Anaconda installer script can be used to install it on Ubuntu 22.04. Hence, in order to achieve this goal, carefully adhere to each of the following instructions:

Step 1: Upgrade the System packages list

Execute the script below to update the system's default repository and get the most recent/updated packages:

sudo apt update

The system's installed packages have been updated.

Step 2: Install Curl & bzip

The installation script for Anaconda can be fetched via curl and bzip is needed by the script to extract the archive. You may install curl & bzip on Ubuntu 22.04 by using the command line interface:

sudo apt install curl bzip2 -y

The Curl is successfully installed on your system.

Step 3: Download the bash script for the Anaconda installer

Run the following command to get the Anaconda installer script:

curl --output anaconda.sh https://repo.anaconda.com/archive/Anaconda3-5.3.1-Linux-x86_64.sh

The installer script for Anaconda has been downloaded.

Step 4: Verify data integrity

Run the following command to see if the Anaconda installer script was downloaded from the official website or not:

sha256sum anaconda.sh

The accuracy of the data is confirmed.

Step 5: Install Anaconda in Ubuntu 22.04

Bash, also referred to as the Bourne Again Shell, includes useful features. Use the anaconda.sh script as follows to install Anaconda on Ubuntu 22.04:

bash anaconda.sh

The Anaconda directory is created within our home directory:

bashrc is set up for anaconda.

After accepting the terms of the licence agreement, Ubuntu 22.04 successfully installs the Anaconda.

It will ask you for the VScode installation, simply press n if you don't want.

Step 6: Activate the Anaconda environment

Due to the fact that Anaconda's bashrc script was already initialized (Step 4, where Anaconda's script was run). To enable the Anaconda environment, run the bashrc script as follows:

source ~/.bashrc

The Anaconda environment is successfully activated.

Step 7: Verify installation

Get the version of Anaconda using the following command to confirm the installation:

conda --version

Ubuntu 22.04 has Anaconda version 4.5.11 installed.

How to Uninstall Anaconda From Ubuntu 22.04

The following command will help you remove or uninstall Anaconda if you installed it through the terminal on Ubuntu 22.04:

rm -rf ~/anaconda3

All the files are forcibly removed/uninstalled using the rm -rf command. The anaconda3 directory has been deleted from the home directory by this command.

That's it! You have successfully installed Anaconda in Ubuntu 22.04.

FAQs to Install Anaconda in Ubuntu 22.04

Can I have both Anaconda and system Python on Ubuntu 22.04?

Yes, you can have both Anaconda and system Python on Ubuntu 22.04. Anaconda creates isolated environments, allowing you to manage different Python versions and packages.

How do I create a new environment in Anaconda on Ubuntu 22.04?

To create a new environment in Anaconda, use the command conda create --name env_name. Replace env_name with the desired name for your environment.

How do I activate an Anaconda environment on Ubuntu 22.04?

To activate an Anaconda environment, use the command conda activate env_name. Replace env_name with the name of the environment you want to activate.

How do I install packages in Anaconda on Ubuntu 22.04?

You can install packages in Anaconda using the command conda install package_name. Replace package_name with the name of the package you want to install.

Can I use pip with Anaconda on Ubuntu 22.04?

Yes, you can use pip with Anaconda on Ubuntu 22.04. However, it's recommended to use conda to install packages whenever possible for better compatibility.

How do I check the version of Anaconda on Ubuntu 22.04?

You can check the version of Anaconda by running the command conda --version in the terminal. It will display the version number of your Anaconda installation.

Conclusion

We hope this detailed tutorial helped you understand how to install Anaconda on Ubuntu 22.04.

If you have any suggestions or queries, kindly leave them in the comments section.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Blog - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.