This document provides a complete guide to installing Anaconda in a system directory (/opt/anaconda3) on Ubuntu-based systems.
This setup installs Anaconda in /opt instead of the default home directory. It is useful for:
- System-wide installations
- Multi-user environments
- Better filesystem organization
Ensure your system has:
- Ubuntu / Debian-based OS
bashshellwgetorcurlsudoprivileges
Update your system:
sudo apt update && sudo apt upgrade -ycd ~/Downloads
wget https://repo.anaconda.com/archive/Anaconda3-2025.12-2-Linux-x86_64.shsha256sum Anaconda3-2025.12-2-Linux-x86_64.shCompare with the checksum from the official Anaconda website.
Run the installer:
sudo bash Anaconda3-2025.12-2-Linux-x86_64.sh
- Press
Enterto scroll - Type
yesto accept the license - Set installation path to:
/opt/anaconda3Allow your user to manage Anaconda without sudo:
sudo chown -R $USER:$USER /opt/anaconda3/opt/anaconda3/bin/conda init
source ~/.bashrcconda --version
which condaExpected output:
/opt/anaconda3/bin/conda
conda create -n test_env python=3.10 -y
conda activate test_env
python --versionCreate a development environment:
conda create -n ai_env python=3.10
conda activate ai_envInstall packages:
pip install opencv-python ultralytics flasksudo chgrp -R users /opt/anaconda3
sudo chmod -R 775 /opt/anaconda3Do not change ownership if multiple users will use Anaconda.
source /opt/anaconda3/bin/activate
conda initsudo chown -R $USER:$USER /opt/anaconda3conda activate <env_name>
which pythonsudo rm -rf /opt/anaconda3Remove conda initialization from ~/.bashrc, then:
source ~/.bashrc- Avoid using the
baseenvironment for development - Prefer isolated environments per project
- Avoid mixing
pipandcondaunnecessarily
For a lighter setup, consider Miniconda.
This guide is provided for educational and development use.