How to Install Conda on Ubuntu 24.04: A Step-by-Step Guide

This article provides a guide to install Conda on Ubuntu 24.04, emphasizing its role in package management and environment creation for data science. It highlights installation via the Conda.sh script, environment isolation features, cross-platform compatibility, and user-friendly command-line and graphical interfaces, making it a versatile tool for various programming languages.

This article explains how to install Conda on Ubuntu 24.04.

Conda is an open-source package management that allows users to easily install, run, and update software packages and their dependencies. It is particularly popular in the data science and scientific computing communities due to its ability to manage complex dependencies and create isolated environments for different projects.

Conda allows users to create multiple isolated environments, which can help prevent dependency conflicts between projects. Each environment can have its own Python version and set of libraries.

It can manage packages beyond Python libraries, including R, Ruby, Lua, and others.

Conda works on Windows, macOS, and Linux, making sharing projects across different operating systems easy. The command-line interface is user-friendly and provides a straightforward way to install, update, and manage packages.

Install Conda on Ubuntu

The easiest way to install Conda is by using its install script, “Conda.sh.”

To install the latest version, visit its package download page. Then, select the latest Conda.sh file for Linux and download it.

Using the command line, one can use wget to download the latest version. An example below.

cd /tmp
wget https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-x86_64.sh

Once downloaded, use the bash command to install it.

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

Select the default install location during the installation and choose ‘Yes‘ for all the prompts.

Version 4.0 | Last Modified: March 31, 2024 | ANACONDA TOS


Do you accept the license terms? [yes|no]
>>> yes

Anaconda3 will now be installed into this location:
/home/richard/anaconda3

- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below

[/home/richard/anaconda3] >>>
..................................
..................................
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

If you'd prefer that conda's base environment not be activated on startup,
run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> yes

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

==> For changes to take effect, close and re-open your current shell. <==

Thank you for installing Anaconda3!

Initialize Conda

Once Conda is installed, run the command below to initialize it.

 source ~/.bashrc

Conda has been activated and initialized if you see “(base)” at the start of the prompt.

(base) richard@Ubuntu:

Conda activates the “base” environment on startup by default. Run the command below to disable and prevent it from activating automatically while in Conda base mode.

conda config --set auto_activate_base false

You can activate the Conda base environment when needed.

Get Conda details

To use Conda, you may want details like its location and version.

Use the command below to list the Conda environment.

conda env list

The command will display all the existing Conda environments on your machine.

# conda environments:
#
base * /home/richard/anaconda3

(base) richard@Ubuntu:/tmp$

Run the command below to display Conda information and version by running the command below.

conda info
conda --version

Activate/Deactivate Conda

To activate Conda, run the command below.

conda activate /home/<yourUsername>/anaconda3

Replace the highlighted field with your username. You can get your Conda environment by running the conda env list command.

To deactivate, run the command below.

conda deactivate

The removal of “(base)” from the start of the prompt indicates that the Conda environment is now deactivated.

Launch Conda Navigator

Run the command below to use the Conda graphical interface while in the base mode.

anaconda-navigator

Use Anaconda Navigator to find useful plugins and applications.

That should do it!

Conclusion:

Installing Conda on Ubuntu 24.04 provides a powerful tool for managing packages and environments in data science and scientific computing. Here are the key takeaways:

  • Ease of Installation: Conda can be quickly installed via the Conda.sh script, simplifying the setup process.
  • Environment Management: Users can create isolated environments to manage dependencies, minimizing project conflicts.
  • Cross-Platform Compatibility: Works seamlessly on Windows, macOS, and Linux, facilitating project-sharing across different operating systems.
  • User-Friendly CLI: The command-line interface makes installing, updating, and managing packages straightforward.
  • Graphical Interface: Anaconda Navigator provides an easy-to-use graphical interface for accessing plugins and applications.
  • Flexibility: Supports multiple programming languages, including R, Ruby, and Lua, extending its usability beyond just Python.

By leveraging Conda, users can efficiently manage their software needs and streamline their development workflow.

Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *