How to Install Anaconda On Ubuntu

Anaconda is a Python distribution that is primary used for applications that are related to data science and machine learning. Just like Python it comes with its own package manager named as conda, the interesting part is that it also comes with its GUI version named as Anaconda Navigator. On Ubuntu, both of its versions can be installed via anaconda installer.

2- Ways to Install Anaconda on Ubuntu

Anaconda not only provides package management but also helps in environment management and comes with pre-installed packages. Further, using the anaconda you can get access to many community-contributed packages via conda-forge.

1: Through Anaconda Installer(CLI)

The first way to install Anaconda on Ubuntu is using its execution file, which you can download by visiting the download section of Anaconda. First fill in the email for to get the download link, it will either redirect you to the download page or will send you the download link to the email:

Getting Download link for Anaconda on Ubuntu

Once you have submitted your email, you need to download the file by clicking on the Download button:

Downloading Anaconda installer file on Ubuntu

Alternatively, if you can use the below command to download the bash file for Anaconda via terminal:

wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh

Downloading Anaconda installer bash file on Ubuntu via terminal.

Once the file is downloaded, you need to verify the integrity of the downloaded file using the SHA-256 command, which ensures that the downloaded installer hasn’t been tampered with and is safe to use.

sha256sum Anaconda3-2024.06-1-Linux-x86_64.sh

Verifying the anaconda downloaded installer file on Ubuntu

Now, execute the bash file for Anaconda by executing the below command:

bash Anaconda3-2024.06-1-Linux-x86_64.sh

Here, first the terms and conditions for anaconda will be displayed and to move further in terms and condition press enter:

Terms and conditions for installing anaconda on Ubuntu

Once you have read the terms and conditions, enter yes:

Accepting the terms and conditions for installing anaconda on Ubuntu

The next thing Anaconda installer will ask, will be the directory for its installation, you can either path for the desired directory here or simply press enter if you want  to go with the current directory:

Updating or adding the anaconda installation directory in Ubuntu

Now at the end Anaconda installer will ask you to deactivate the shell, so for that enter yes:

Deactivating anaconda shell after its installation on Ubuntu

Here you will see the message for successful installation of anaconda on Ubuntu:

Installation completed for Anaconda on Ubuntu

Further, to verify the installation of Anaconda you can check its details by executing the below command:

conda info

 

Verifying the details of anaconda installed on Ubuntu

To detective the anaconda shell in Ubuntu, use the following command:

conda deactivate

Deactivating anaconda virtual environment

Here, I have installed the latest version of Anaconda for Linux, however you can install the older versions as well and for that you need to visit anaconda archives:

Archive for Anaconda versions for Linux/Ubuntu

2: Through Anaconda Navigator (GUI)

There is also a GUI version of Anaconda as well which is known as Anaconda Navigator, this is useful if you are not good with using commands. To install Anaconda navigator on Ubuntu, you need to install its command line version and then execute the below command:

conda install anaconda-navigator

Installing Anaconda GUI (Anaconda Navigator) on Ubuntu

To launch Anaconda navigator on Ubuntu, you need to switch to bin directory of anadona3 using the below commands:

cd anaconda3/bin
anaconda-naviagtor

Launching Anaconda Navigator on Ubuntu

Next, in order to install packages via Anaconda, you have to connect to one of its repositories:

 

Anaconda Navigator on Ubuntu.

How To Connect to Anaconda Repositories using Anaconda Navigator

To connect to Anaconda repositories, click on Connect and then select any one of them, here for demo I am selecting the Anacodna.org:

Connecting Anaconda repositories with Anaconda navigator on Ubuntu

Next, since you are connecting for the first time, you need to create an account on anaconda.org and for that click on the click here:

Logging in to Anaconda.org repository to connect it with Anaconda navigator

Now enter your details and after that agree to its terms and conditions, afterwards click on Register for Free:

Registering for Anaconda.org repository on Ubuntu for Anaconda Repository

After that you will receive the conformation or verification of account email, verify the account and then login to Anaconda Navigator. Once the Anaconda.org repository is connected, you will see its conformation in the top right corner:

Connected anaconda.org to Anaconda Navigator on Ubuntu

Commands For Using Anaconda on Ubuntu

If you are new to Anaconda distribution in Ubuntu, then below is the table that gives some of the basic commands that you can use:

CommandDescription
conda create -n [virtual;-environment-name python=[python-version]Creates a new environment with desired Python version.
conda activate [Name-of-environment]To activate the environment.
conda deactivateTo deactivates the current virtual environment.
conda listFor listing all the current environment installed programs/apps
conda install [app/package-name]To install any app or package via conda package manage.
conda remove [app/package-name]To uninstall or remove any application or package.
conda update [app/package=name]To update any specific application or package
conda update –allTo update all packages in the current environment.
conda info –envsLists all available virtual environment.
conda create –clone [current-virtual-environmment] [name -for-new-clone]Clones the current virtual environment to create a new one.

Conclusion

This post discussed two ways for installing Anaconda on Ubuntu one method installs the command line version and the other installs the GUI version named as Anaconda Navigator. To install both, you need to download anaconda installer bash file. Further, for Anaconda Navigator you need to connect it to any of the anaconda repository.

 

Index
Scroll to Top