How to Install Conda on Ubuntu 24.04: A Step-by-Step Guide
You install Conda on Ubuntu 24.04 by downloading the Miniconda installer script and running it in your terminal.
Conda is an open-source package and environment manager that streamlines installing and managing software, especially vital for data science workflows. It enables you to create isolated environments, preventing dependency conflicts between different projects.
For example, you can manage a Python 3.9 environment for one project and a separate Python 3.11 environment for another on the same Ubuntu 24.04 system. Conda supports packages beyond Python, including R and Lua.
Download the Miniconda installer script from the official website. Then, run the script using bash in your terminal, accepting the license terms and default installation location. Finally, initialize Conda by sourcing your .bashrc file.
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.shscript, 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.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!