Website Vidya
Linux & ServersStep-by-Step Guide

How to Install Anaconda Python on Ubuntu 24.04

Complete guide to install Anaconda on Ubuntu 24.04 LTS with SHA-256 checksums, Conda environment setup, package management, and Jupyter tips.

RR
Rajesh RayLead Systems Educator
Published:
6 min read
PDF Cheat Sheet
How to Install Anaconda Python on Ubuntu 24.04
AI Executive SummaryWebsiteVidya AI

6 min read

Complete guide to install Anaconda on Ubuntu 24.04 LTS with SHA-256 checksums, Conda environment setup, package management, and Jupyter tips.

Key Highlights
  • Prerequisites and Supported Releases
  • Step 1: Installing Prerequisites and System Dependencies
  • Step 2: Downloading the Official Anaconda Linux Installer
Grounded in full engineering runbookWebsiteVidya AI Engine

Data science engineering, machine learning research, and numerical computing workflows require pre-configured software stacks bundling linear algebra libraries, statistical packages, and interactive notebook runtimes. When you install anaconda on ubuntu 24.04, you deploy an all-in-one data science platform that includes over 250 scientific computing packages (such as NumPy, Pandas, SciPy, Matplotlib, and Scikit-Learn) alongside the powerful conda package and environment management system.

Unlike standard Python virtual environments created via venv, Conda is a language-agnostic package manager that handles non-Python binary dependencies, CUDA drivers, and compiled C/Fortran libraries automatically. This tutorial guides you through acquiring the installer, performing SHA-256 cryptographic verification, configuring environment initialization, managing Conda virtual environments, and preventing common shell path conflicts.

Prerequisites and Supported Releases

This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat) & Ubuntu 22.04 LTS. The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.

Advertisement

Before proceeding, ensure you have the following requirements satisfied:

  • A 64-bit installation of Ubuntu 24.04 LTS (Desktop or Server).
  • A standard non-root user account with sudo administrative privileges.
  • At least 5 GB of free disk space for Anaconda binaries and package caches.
  • An active Internet connection to download installer archives and packages.

Step 1: Installing Prerequisites and System Dependencies

The libgl1-mesa-glx package provides OpenGL rendering libraries utilized by graphical Anaconda tools such as Anaconda Navigator and Matplotlib.

# Refresh package lists and install retrieval dependencies
sudo apt update
sudo apt install -y curl bzip2 libgl1-mesa-glx

Step 2: Downloading the Official Anaconda Linux Installer

Anaconda is distributed as a self-extracting shell installer script. Navigate to your temporary directory and download the latest 64-bit x86 Linux installer from the official Anaconda distribution mirror.

Use curl to fetch the installer script:

Advertisement
# Navigate to /tmp
cd /tmp

# Download the latest Anaconda3 installer for Linux x86_64
curl -O https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh

Step 3: Cryptographically Verifying the Installer SHA-256 Checksum

Compare the computed 64-character hexadecimal string against the published checksum on the official Anaconda website before proceeding with execution.

# Compute the SHA-256 checksum of the downloaded file
sha256sum Anaconda3-2024.06-1-Linux-x86_64.sh

# Sample output:
# c5b7f16ef0a41d50b449b2c34cb2c48da40e29b13936081e649537ff5a3b934b  Anaconda3-2024.06-1-Linux-x86_64.sh

Step 4: Running the Anaconda Installation Script

Execute the downloaded shell installer using standard bash. Do NOT execute the installer using sudo; Anaconda should always be installed within your personal user directory to avoid permission conflicts when updating packages.

Run the installer script:

# Run the installer as your normal user
bash Anaconda3-2024.06-1-Linux-x86_64.sh

1. License Agreement: Press Enter to begin viewing the End User License Agreement. Press the Spacebar repeatedly to scroll to the bottom, then type yes and press Enter to accept the terms.

Advertisement

2. Installation Location: When prompted for the install location (defaulting to /home/username/anaconda3), press Enter to accept the default path.

3. Conda Initialization: At the prompt 'Do you wish to update your shell profile by running conda init? [yes|no]', type yes. This appends Conda initialization scripts to your ~/.bashrc file.

Step 5: Activating the Environment and Managing Base Shell Behavior

To activate the Anaconda environment and update your terminal's PATH, source your updated shell configuration file.

Once sourced, your terminal prompt will display a (base) prefix indicating that the default Conda environment is active.

# Source ~/.bashrc to load Conda into your active session
source ~/.bashrc

# Verify the installed Conda and Python versions
conda --version
python --version

By default, Conda activates its (base) environment on every new terminal session, overriding Ubuntu's system Python. If you prefer to activate Conda manually only when working on data science projects, disable auto-activation:

# Prevent conda base from automatically activating on terminal startup
conda config --set auto_activate_base false

Step 6: Creating and Managing Isolated Conda Environments

Best practices dictate never installing project dependencies directly into the root (base) environment. Instead, create isolated environments for individual projects with pinned Python versions.

Create a new environment named py311-ds running Python 3.11 with core scientific packages:

# Create an isolated environment with Python 3.11, pandas, and scikit-learn
conda create --name py311-ds python=3.11 pandas scikit-learn matplotlib -y

# Activate the newly created environment
conda activate py311-ds

# Verify the active environment's Python location
which python

# Deactivate the environment when finished
conda deactivate

Step 7: Launching Jupyter Notebook and Updating Anaconda

Anaconda includes Jupyter Notebook and JupyterLab out of the box. To launch the interactive browser-based notebook interface, run:

Jupyter launches an internal web server and opens the interactive dashboard in your default browser.

# Launch Jupyter Notebook from your terminal
jupyter notebook &

# Update all packages in the active Conda environment to their latest versions
conda update --all -y

Step 8: Completely Uninstalling Anaconda from Ubuntu 24.04

Finally, open ~/.bashrc in a text editor and delete the code block delineated between # >>> conda initialize >>> and # <<< conda initialize <<<.

# Remove the main Anaconda directory
rm -rf ~/anaconda3

# Remove hidden configuration and cache directories
rm -rf ~/.conda ~/.continuum

Troubleshooting and Common Errors

When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:

conda: command not found after running installer.

Cause: The terminal session was not reloaded after the installer updated ~/.bashrc.

Resolution: Source your bash profile manually: source ~/.bashrc or export PATH: export PATH=$HOME/anaconda3/bin:$PATH.

source ~/.bashrc

Conda environment solving hangs indefinitely during package installation.

Cause: The default classic solver struggles with complex dependency trees.

Resolution: Switch to the high-performance Libmamba solver: conda install -n base conda-libmamba-solver && conda config --set solver libmamba.

conda config --set solver libmamba

Jupyter Notebook fails to launch in browser: 'No web browser found'.

Cause: Running on a headless server without a desktop display or browser installed.

Resolution: Launch Jupyter without a browser and copy the localhost token link: jupyter notebook --no-browser --port=8888.

jupyter notebook --no-browser --port=8888

Security Best Practices and Hardening

Never install or execute Anaconda using sudo.

Installing packages under root alters permissions on ~/anaconda3 and exposes your host operating system to supply-chain risks.

Always manage Conda as a standard unprivileged user.

Prioritize packages from the community-vetted conda-forge channel over untrusted third-party channels, and lock production environment specifications using conda env export > environment.yml.

Periodically audit active virtual environments for outdated dependencies and known CVEs using automated supply chain scanning tools.

Deepen your Linux system administration skills with our related production-tested guides:

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

4 FAQs
Anaconda is a comprehensive distribution bundling Python, Conda, and over 250 data science packages (approx. 5 GB disk usage). Miniconda is a minimal installer containing only Python, Conda, and essential dependencies (approx. 400 MB disk usage), allowing you to install only the packages you need.
Yes. You can run pip install <package> inside an activated Conda environment. However, best practice is to install packages via conda install first whenever available, and use pip only for packages not present in the Conda or conda-forge channels.
Execute conda env list or conda info --envs. The active environment is marked with an asterisk (*).
The (base) label indicates that Conda's default root environment is currently active in your shell. To prevent this from loading automatically, run conda config --set auto_activate_base false.
RR
Written byVerified Author

Rajesh Ray

I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout