How to Install Anaconda on Ubuntu 20.04 LTS

How to Install Anaconda on Ubuntu 20.04 LTS

Anaconda is an open-source distribution of Python which includes some installation and package management utilities. It assists you in installing some popular Python and additional packages.. Anaconda has its own package manager known as Conda which helps in installing packages and creating Python environments. Its applications are in deep learning, machine learning, and data science fields.

In this post, we will describe the step by step method for the installation of Anaconda on Ubuntu OS.

Note: The steps demonstrated here have been tested on Ubuntu 20.04 LTS (Focal Fossa).

Step 1: Downloading Anaconda Installer Script

First, you will have to download the Anaconda installer latest version from its official website. Alternatively, you can use the command below to download the Anaconda installer:

$ wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh

You can find the downloaded installer script in your current Terminal’s directory.

Step 2: Verify Integrity

It is better to check the integrity of the bash script installer file you downloaded from the website using SHA-256. Create the sha256 cryptographic hash of the installer file using this command to validate its integrity:

$ sha256sum Anaconda3-2021.05-Linux-x86_64.sh

Now match its result to the hashes available at the Anaconda website for your installer script. If the result doesn’t match, it indicates either the installer script is either not completely downloaded or broken. If the result matches, proceed to the next step.

Step 3: Running the Anaconda Installer

Now in order to install Anaconda, you will need to run the Anaconda installer script. Use the below command to do so:

$ bash Anaconda3-2021.05-Linux-x86_64.sh

Hit Enter to Continue and view the license terms.

Scroll down to read the license terms. Then type yes and hit Enter to accept the terms.

Then you will be asked to specify an installation directory or to just hit Enter to accept the default installation location. After that, the installation will be started.

You will be then asked if you want to initialize the Anaconda by running conda init. Type yes and hit Enter.

After the installation is finished, you will see the below output:

Now close and re-open your Terminal to activate the installation. On the other hand, you can also use the command below for this purpose:

$ source ~/.bashrc

To verify if the Anaconda has been properly installed and activated, use the command below:

$ conda list

If everything is done correctly, you’ll get a list of all the packages available to you through the Anaconda installation.

Uninstall Anaconda

You can also uninstall Anaconda if you do not require it anymore on your system:

To Uninstall Anaconda, you will first need to install the anaconda-clean package using the command below:

$ conda install anaconda-clean

Then using the below command, remove all the Anaconda-related files directories, packages, and cache.

$ anaconda-clean –yes

Also, use the below command to remove the anaconda directory from the Home directory:

$ rm -rf ~/anaconda3

In this post, we explained step by step procedure for the installation of Anaconda on Ubuntu OS. We also explained how to uninstall Anaconda. You can check Anaconda’s official documentation for further information.

Similar Posts