thelinuxvault blog

Installing Anaconda on Ubuntu 24.04: A Comprehensive Guide

Anaconda is a popular, open-source distribution of Python and R designed specifically for data science, machine learning, and scientific computing. It simplifies package management and environment setup by bundling over 1,500 pre-installed packages (such as NumPy, Pandas, TensorFlow, and scikit-learn) and a powerful package manager called Conda.

If you’re using Ubuntu 24.04 (Noble Numbat), a long-term support (LTS) release known for stability and security, setting up Anaconda will equip your system with a robust environment for data science workflows. This guide walks you through the entire process—from downloading the installer to verifying the installation—with detailed, step-by-step instructions.

2026-02

Table of Contents#

  1. Prerequisites
  2. Step 1: Download the Anaconda Installer
  3. Step 2: Verify the Installer Integrity
  4. Step 3: Run the Anaconda Installer Script
  5. Step 4: Configure the Installation
  6. Step 5: Verify the Installation
  7. Step 6: Update Anaconda (Optional)
  8. Uninstalling Anaconda (Optional)
  9. Troubleshooting Common Issues
  10. Conclusion
  11. References

Prerequisites#

Before starting, ensure your system meets the following requirements:

  • Ubuntu 24.04 LTS: This guide is tailored for Ubuntu 24.04, but the steps are similar for other Debian-based distributions.
  • 64-bit System: Anaconda requires a 64-bit Linux OS. Verify with uname -m (output should be x86_64).
  • Internet Connection: To download the installer and update packages.
  • Terminal Access: You’ll need a terminal (press Ctrl+Alt+T to open one).
  • Basic Terminal Skills: Familiarity with navigating directories and running commands (we’ll guide you through specifics).

Step 1: Download the Anaconda Installer#

Anaconda provides installers for Linux on its official website. We’ll use the latest version of Anaconda3 (which includes Python 3.x, the recommended version for new projects).

Option 1: Download via the Anaconda Website#

  1. Open a web browser and navigate to the Anaconda Individual Edition Downloads page.
  2. Under “Linux,” right-click the “64-bit (x86_64)” installer link and select “Copy Link Address” to copy the download URL.

Option 2: Download via Terminal (Faster)#

For a terminal-only approach, use wget to download the installer directly. Replace <INSTALLER_URL> with the URL copied in Step 1:

wget <INSTALLER_URL>

Example (replace with the latest version URL):

wget https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh

The installer filename will follow the pattern: Anaconda3-<VERSION>-Linux-x86_64.sh.

Step 2: Verify the Installer Integrity#

To ensure the installer hasn’t been corrupted or tampered with, verify its SHA256 checksum against the official Anaconda hashes.

Step 2.1: Download the Official SHA256 Hash File#

  1. Visit the Anaconda Installer Hash Verification page.
  2. Find the SHA256 hash for your installer version (e.g., Anaconda3-2024.02-1-Linux-x86_64.sh) and copy it.

Step 2.2: Verify the Installer Checksum#

In the terminal, run sha256sum on the downloaded installer file to generate its checksum. Compare it to the official hash:

sha256sum Anaconda3-<VERSION>-Linux-x86_64.sh

Example output:

a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2  Anaconda3-2024.02-1-Linux-x86_64.sh

If the generated hash matches the official one, the installer is valid. If not, re-download the installer (corruption may have occurred during download).

Step 3: Run the Anaconda Installer Script#

Once the installer is downloaded and verified, make it executable and run the installation script.

Step 3.1: Make the Installer Executable#

In the terminal, navigate to the directory where the installer was downloaded (usually ~/Downloads):

cd ~/Downloads

Make the script executable with chmod:

chmod +x Anaconda3-<VERSION>-Linux-x86_64.sh

Step 3.2: Launch the Installer#

Run the installer script:

./Anaconda3-<VERSION>-Linux-x86_64.sh

Step 4: Configure the Installation#

The installer will guide you through setup with prompts. Follow these steps:

1. License Agreement#

  • Press Enter to scroll through the license agreement.
  • When prompted, type yes and press Enter to accept the license.

2. Install Location#

  • The installer will propose a default location (e.g., /home/your_username/anaconda3).
  • To accept the default, press Enter.
  • To choose a custom location, type the path (e.g., /opt/anaconda3) and press Enter. Note: Custom paths may require sudo if outside your home directory, but Anaconda recommends user-level installs.

3. Add Anaconda to PATH#

  • The installer will ask: “Do you wish the installer to initialize Anaconda3 by running conda init?”
    • Type yes (recommended for new users). This adds Anaconda to your system’s PATH, allowing you to run conda and python commands directly in the terminal.
    • If you select no, you’ll need to manually configure PATH later (see Troubleshooting for details).

4. Complete Installation#

Once configuration is done, the installer will unpack and install Anaconda. This may take 5–10 minutes depending on your internet speed.

Step 5: Verify the Installation#

After installation, close and reopen your terminal to apply changes. Alternatively, refresh your terminal session with:

source ~/.bashrc  # For Bash users (default on Ubuntu)
# OR
source ~/.zshrc   # For Zsh users (if you use Zsh instead of Bash)

Check Conda Version#

Run this command to confirm Conda is installed:

conda --version

Example output:

conda 24.3.0

Check Python Version#

Anaconda includes its own Python interpreter. Verify it with:

python --version

Example output:

Python 3.11.7

List Installed Packages#

To confirm Anaconda’s pre-installed packages (e.g., NumPy, Pandas), run:

conda list

You’ll see a list of packages with versions, confirming the installation succeeded.

Step 6: Update Anaconda (Optional)#

It’s good practice to update Anaconda immediately after installation to get the latest packages and security patches.

Update Conda#

First, update the Conda package manager itself:

conda update conda

Type yes when prompted to proceed with updates.

Update All Packages#

Next, update all Anaconda packages to their latest versions:

conda update anaconda

Again, type yes to confirm.

Uninstalling Anaconda (Optional)#

If you need to remove Anaconda later, follow these steps:

1. Delete the Anaconda Directory#

Remove the Anaconda installation folder (replace ~/anaconda3 with your custom path if used):

rm -rf ~/anaconda3

2. Remove Conda Initialization from Shell Configuration#

Anaconda adds initialization code to your shell config file (e.g., ~/.bashrc, ~/.zshrc). To clean this up:

  1. Open the config file in a text editor (e.g., nano):

    nano ~/.bashrc
  2. Scroll to the bottom and delete all lines between # >>> conda initialize >>> and # <<< conda initialize <<<.

  3. Save and exit: Press Ctrl+O, then Enter, then Ctrl+X.

3. Refresh the Terminal#

Apply changes by restarting the terminal or running:

source ~/.bashrc

Troubleshooting Common Issues#

Issue: “conda: command not found”#

If conda isn’t recognized after installation, Anaconda wasn’t added to PATH. Fix this by:

  1. Opening your shell config file:
    nano ~/.bashrc
  2. Adding this line at the bottom (replace your_username with your actual username):
    export PATH="/home/your_username/anaconda3/bin:$PATH"
  3. Save, exit, and refresh:
    source ~/.bashrc

Issue: Permission Errors During Installation#

If you see Permission denied, you likely tried to install Anaconda in a system directory (e.g., /usr/local) without sudo. Instead, install in your home directory (default) or use sudo with caution:

sudo ./Anaconda3-<VERSION>-Linux-x86_64.sh

Issue: 32-bit vs. 64-bit Mismatch#

If the installer fails with invalid ELF header, you downloaded the 32-bit installer by mistake. Ensure you use the 64-bit (x86_64) installer for Ubuntu 24.04.

Conclusion#

You’ve successfully installed Anaconda on Ubuntu 24.04! Anaconda provides a robust, pre-configured environment for data science, with tools like Conda for package management and Python for scripting.

Next steps:

  • Create isolated environments with conda create --name myenv python=3.11 (replace myenv with your environment name).
  • Install additional packages with conda install package_name.
  • Explore Anaconda Navigator (a GUI) by running anaconda-navigator in the terminal.

References#