May 10, 2024

Tutorial on How to Install Anaconda on Linux Computer (Ubuntu)

In this Anaconda and Linux tutorial, we explain how to install Anaconda on a Linux Computer. We explain how to install Anaconda on a Ubuntu Linux version. The YouTube tutorial accompanying this page is given below.

First, we need to update the package list on the Linux system. To do that, we start a Linux terminal and we type

sudo apt-get update

Then, to use GUI packages, we need to install the following extended dependencies for Qt

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

Next, we need to download the Anaconda installation file. To do that, go to the Anaconda installation page, and download the installation file (see the YouTube tutorial for more details). By default, the file will be downloaded to the “Downloads” folder which is usually located in the home folder. In our case, the name of the file is

Anaconda3-2023.07-2-Linux-x86_64.sh

However, in your case, the name of the file might be slightly different since you will most likely download a newer version. Next, open a new terminal and navigate to the folder in which this file is downloaded. You can do that by typing “cd ~/Downloads/” (if the file is downloaded to the “Downloads” folder). Then, type in the terminal

shasum -a 256 Anaconda3-2023.07-2-Linux-x86_64.sh

This will verify the installer’s data integrity. Then, let us set the executable permissions to the downloaded file:

chmod +x Anaconda3-2023.07-2-Linux-x86_64.sh

Finally, let us run the installed file:

./Anaconda3-2023.07-2-Linux-x86_64.sh

During the installation, you will be asked to accept the license terms. You need to answer yes. Also, you will be asked for the installation location. You can choose the default installation folder. Finally, you will be asked if you want to add Anaconda to the path. The best answer is to add Anaconda to the Path. After some time, you will get a question asking you do you want Anaconda to initialize Anaconda Distribution by running “conda init“. My suggestion is to answer yes. Then, after the installation is completed run:

source ~/.bashrc

To refresh the terminal. You will observe that the Anaconda base environment is automatically started. Also, if you open a new terminal, you will observe that the Anaconda base environment automatically starts. We do not want that. To fix this problem, type in the terminal window:

conda config --set auto_activate_base False

This will make sure that Anaconda’s base environment does not automatically start with the terminal. To verify the installation type in the new terminal window:

conda list

If Anaconda is properly installed, this will list all the installed packages in the current Anaconda environment. Next, let us learn how to start our Anaconda base environment. We can do that by typing:

conda activate

Finally, to start the Anaconda graphic user interface, that is, to start the Anaconda navigator, we type:

anaconda-navigator

This should be done after “conda activate”.