How to install Anaconda in Ubuntu?


Gaming Laptop Series

Anaconda is a package manager, environment manager, and distribution of Python and R programming languages for data science, machine learning, predictive analysis, large-scale data processing, etc.

It comes with over 250 automatically installed and more than 7500 packages can be installed from PyPI and conda. Conda is a package manager using which package versions in Anaconda are managed.

In this article, I will discuss how to install and use Anaconda in Ubuntu Linux.

Prerequisites

You should have access to a user account with superuser privileges.

Download the Anaconda installation script

We will install Anaconda using the installation script. To download it first go to the downloads page of Anaconda’s website. Now click on Download as given in the image below.

anaconda download page

Alternatively, you can use the given command to download Anaconda in your terminal.

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

Optionally you can verify the data integrity of the installer by using –

sha256sum /tmp/Anaconda3-2021.05-Linux-x86_64.sh

This will display output something like given in the image below.

integrity check

This checksum should match with the sha256sum hash code given on the download page of the Anaconda installer.

To use Anaconda Navigator which is a Qt-based GUI you need to install some additional packages. So if you want to use the Anaconda in graphical mode then install the following packages –

sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6

Run the anaconda installation script by using –

bash /tmp/Anaconda3-2021.05-Linux-x86_64.sh

When executes it will display-

install anaconda

Pressing ENTER will display the end-user license agreement you can scroll and read it by pressing the enter key. At last, if it asks you that Do you want to accept the license terms[yes/no]? type yes and then press enter.

Next, it will ask you for the installation location

confirm installation location

Press enter to confirm the location and continue with the installation process.

When the installation gets completed it will display the given output.

installation complete

If you want to initiate Anaconda3 by running conda init then type yes and press enter.

This will add the command-line package manager conda to your system’s PATH . To make the changes effective you need to restart your shell.

Launch Anaconda Navigator

If you are using a desktop then you can launch Anaconda in GUI mode. Execute the given command to start the Anaconda Navigator –

anaconda-navigator

anaconda navigator

You can launch an application directly from the interface of Anaconda Navigator.

Update Anaconda in Ubuntu

Run the following command to update the Anaconda application in your system.

conda update --all

Conclusion

This is how you can install Anaconda on your Ubuntu system. If you have a query then write us in the comments below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.