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.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Python packages queries. You can check Anaconda's official documentation for further information.
In this context, we shall look into step by step method for the installation of Anaconda on Ubuntu 20.04 LTS (Focal Fossa).
1. Download 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.
2. Verify Integrity of the Installer
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.
3. Run 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.
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.
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
This article covers step by step procedure for the installation of Anaconda on Ubuntu OS. In fact, Anaconda is designed to provide scientific libraries and dependencies in the Python programming language. It is a package manager used in scientific computing and data science.