Conda handles Python packages, libraries, and isolated environments through a single tool, which saves you from dependency clashes when running multiple projects. This walkthrough covers the full process to install Conda on Ubuntu, from system updates to spinning up your first environment. The steps apply to Ubuntu 20.04, 22.04, and 24.04.
Prerequisites Before You Install Conda on Ubuntu
Refresh your package index first so Ubuntu pulls the latest dependency versions:
sudo apt-get update
If you are new to the terminal, this beginner’s walkthrough of the Linux command line covers the basics you will need across the rest of this guide.
You also need Curl to grab the installer. Add it with:
sudo apt-get install curl
If Curl throws a missing-binary error, the guide on fixing the curl command not found message resolves it in a few steps. A failing apt-get itself usually points to a different issue covered in this apt-get troubleshooting reference.
Download the Anaconda Installer for Ubuntu
Open https://www.anaconda.com/products/individual and pick the latest Linux x86_64 build. To skip the browser, pull the script straight into /tmp with Curl:
cd /tmp
curl -O https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
The -O flag tells Curl to save the file under its original name. For a wider look at Curl options, see this reference on cURL GET commands.
Run the Conda Installation Script
Once the download finishes, execute it with bash:
bash Anaconda3-2020.11-Linux-x86_64.sh
Anaconda installs to /home/<username>/anaconda3 by default. Replace <username> with your actual login. Accept the license terms and press Enter to confirm the path when prompted.
After the installer wraps up, reload your shell configuration so the new PATH entry registers:
source ~/.bashrc
Confirm the install with:
conda -V
Expected output: conda 4.9.2 (your version may be higher).
Keep Conda Updated on Ubuntu
Run these two commands periodically to stay current:
conda update conda
conda update anaconda
The first updates the Conda package manager itself. The second updates the full Anaconda distribution along with its bundled libraries. To see everything Conda has installed on your system, the same logic applies as when you list installed apt packages with the system package manager.
Create and Manage a Conda Environment on Ubuntu
With the install Conda Ubuntu setup done, you can spin up isolated environments per project. Create one named My_env1 with Python 3:
conda create --name My_env1 python=3
Activate it:
conda activate My_env1
Switch it off when finished:
conda deactivate
Install a package inside the active environment:
conda install <package-name>[=version]
Swap <package-name> with whatever library you need. The [=version] portion is optional, so omit it for the latest compatible build, or pin a release the same way you install a specific apt package version. For Python libraries that ship through PyPI rather than Conda channels, this guide to installing pip on Linux shows how to mix both inside the same environment.
FAQs
Can I install Conda on Ubuntu without sudo?
Yes. The Anaconda script writes to your home directory and does not need root access. Run bash Anaconda3-*.sh as a regular user and accept the default install path under /home/<username>/anaconda3.
What is the difference between Anaconda and Miniconda on Ubuntu?
Anaconda ships with 250+ pre-installed data science packages and takes around 3 GB. Miniconda includes only Conda and Python, weighing about 400 MB. Pick Miniconda for lean setups or container builds.
How do I uninstall Conda from Ubuntu?
Remove the install directory with rm -rf ~/anaconda3. Then open ~/.bashrc and delete the conda initialize block at the bottom. Run source ~/.bashrc to apply the change in the current shell.
Why does the conda command not work after installation?
The shell has not loaded the updated PATH. Run source ~/.bashrc or close and reopen the terminal. If the issue persists, check ~/.bashrc for the conda init lines and rerun the installer if missing.
Can I use pip inside a Conda environment?
Yes. Activate the environment first, then run pip install package-name. Mixing both works for libraries Conda lacks, but stick with conda install when the package is available on a Conda channel.