I wrote this post because I always install my programs and associated packages such as drivers in a virtual Anaconda environment and it is therefore important that you understand how Anaconda is set up under Ubuntu. The big advantage that comes with this is that you can simply delete the Anaconda environments with your installation without making any changes to your underlying Ubuntu system itself. Now it’s time to install Anaconda.

First of all, check which Anaconda version is the right one for your Ubuntu Linux system and, above all, which is the latest version. To do this, open the following link.

URL: https://repo.anaconda.com/archive/

In April 2023 it was the version of the installation script Anaconda3-2023.09-0-Linux-x86_64.sh which has the following URL. You must now copy the current URL that suits you to the clipboard. We will need this later for the installation.

URL: https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh

I have also recorded a video here that explains the installation steps along my description here.

Anaconda Installation Ubuntu Video

Anaconda Installation Ubuntu Video

Now let’s get started with the installation. First of all, you should update the system with the following command.

Command: sudo apt-get update

Then please install curl as we need curl to download and run the installation script.

Command: sudo apt install curl -y

I then created a working folder with the following two commands and went directly to this folder in the terminal window.

Command: mkdir anaconda

Command: cd anaconda

Now execute the following command in the working folder anaconda. Please paste the URL to the installation script here. You have previously copied this to the clipboard.

Command: curl --output anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh

Now you can generate the checksum from the script and compare it with the information on the Anaconda archive page. This way you can be reasonably sure that you are executing the correct script for the installation.

Command: sha256sum anaconda.sh

You can now start the installation with the following command. Anaconda will then be installed on your system.

Command: bash anaconda.sh

You have to enter YES a few times and finally I would suggest No when asked whether the Anaconda environment should always start. If you have answered all questions with YES, you can deactivate the automatic start of the Anaconda environment with the following optional command.

Command optional: conda config --set auto_activate_base false

Many of the commands for operating Anaconda are summarized in the following PDF. This will certainly help you to get started with Anaconda as software.

URL: conda-cheatsheet.pdf

First of all, conda must be activated. If you do not want to restart the computer, please execute the following command.

Command: source ~/anaconda3/bin/activate

Now follows the command with which a new virtual environment can be created.

Command: conda create --name <NAME_OF_THE_VIRTUAL_ENVIRONMENT>

If you now want to create a virtual environment with a specific Python version, the command must look like this.

Command: conda create --name <NAME_OF_THE_VIRTUAL_ENVIRONMENT> -c conda-forge python=3.11

Now use the following command to create a virtual environment called “stable-diffusion”. You can then install your software in this environment.

Command: conda create --name stable-diffusion

You can start this environment with the following command.

Command: conda activate stable-diffusion

If you want to leave the virtual environment, use this command to exit Anaconda.

Command: conda deactivate

Now you have the virtual environment running and can install drivers in it and do what you want without affecting the actual Ubuntu environment with your actions.

Summary Anaconda

For me, the use of Anaconda has already paid off in my projects. It allows me to run many installations in parallel without destroying my Ubuntu system. This saves me a lot of time and, above all, error analysis is so much easier as there are virtually no dependencies on the operating system itself and the other virtual Anaconda environments. I therefore highly recommend the use of a virtual environment.