Ubuntu

Install Conda on Ubuntu 24.04

Python and R programming languages rely on Anaconda as their package and environment manager. With Anaconda, you will get tons of the necessary packages for your data science, machine learning, or other computational tasks.To utilize Anaconda on Ubuntu 24.04, install the conda utility for your Python flavor. This post shares the steps for installing conda for Python 3, and we will install version 2024.2-1. Read on!

How to Install conda n Ubuntu 24.04

Anaconda is an open-source platform and by installing conda, you will have access to it and use it for any scientific computational tasks, such as machine learning. The beauty of Anaconda lies in its numerous scientific packages, ensuring you can freely use it for your project needs.

Installing conda on Ubuntu 24.04 follows a series of steps, which we’ve discussed in detail.

Step 1: Downloading the Anaconda Installer
When installing Anaconda, you should check and use the latest version of the installer script. You can access all the latest Anaconda3 installer scripts from the Anaconda Downloads Page.

As of writing this post, we have version 2024.2-1 as the latest version, and we can go ahead and download it using curl.

$ curl https://repo.anaconda.com/archive/Anaconda3-2024.2-1-Linux-x86_64.sh --output anaconda.sh

Ensure you change the version when using the above command. Also, navigate to where you want the installer script to be saved. In the above command, we’ve specified to save the installer as anaconda.sh, but you can use any preferred name.

The installer script is large and will take some time, depending on your network’s performance. Once the download is completed, verify the file is available using the ls command. Another crucial thing is to check the integrity of the installer script.
To do so, we’ve used the SHA-256 checksum by running the below command.

$ sha256sum anaconda.sh

Once you get the output, confirm that it matches against the available Anaconda3 hashes from the website. Once everything checks out, you can proceed with the installation.

Step 2: Run the conda Installer Script
Anaconda has an installer script that will take you through installing it. To run the bash script, execute the below command.

$ bash anaconda.sh

The script will trigger different prompts that will walk you through the installation. For instance, you must press the Enter key to confirm that you are okay with the installation.
Next, a document containing the lengthy Anaconda license agreement will open.

Please go through it, and once you reach the bottom, type yes to confirm that you agree with the license terms.

You must also specify where you want the installation to be installed. By default, the script selects a location in your home directory, which is okay in some instances. However, if you prefer a different location, specify it and press the enter key again to proceed with the process.

Conda will start installing, and the process will take a few minutes. In the end, you will get prompted to initialize Anaconda3. If you wish to initialize it later, choose ‘no.’ Otherwise, type ‘yes,’ as in our case.

That’s it! You will get an output thanking you for installing Anaconda3. This message confirms that the conda utility was installed successfully on Ubuntu 24.04, and you now have the green light to start using it.

Step 3: Activate the Installation and Test Anaconda3
Start by sourcing the ~/.bashrc with the below command.

$ source ~/.bashrc

Next, restart your shell to open up in the Anaconda3 base environment.
You can now check the installed conda version.

$ conda --version

Better yet, you can view all the available packages by listing them using the command below.

$ conda list

With that, you’ve installed Conda on Ubuntu 24.04. You can start working on your projects and maximize the power of Anaconda3 courtesy of its multiple packages.

Conclusion

Anaconda is installed by installing the conda command-line utility. To install conda, you must download its installer script, execute it, go through the installation prompts, and agree to the license terms. Once you complete the process, you can use Anaconda3 for your projects and leverage all the packages it offers.

About the author

Denis Kariuki

Denis is a Computer Scientist with a passion for Networking and Cyber Security. I love the terminal, and using Linux is a hobby. I am passionate about sharing tips and ideas about Linux and computing.