Guide to Setting Up Mamba (Conda) on a Linux Machine
Author: Callum Smith, Oct 2025 (last updated: Oct 2025)
What is Mamba?
You might have heard of Conda (Anaconda), a package management software for Python. Mamba is the newer, faster, more robust, and more user-friendly package manager for managing environments and packages than traditional Conda. It is a drop-in replacement for the Conda command-line tool, written in C++ for speed and efficiency. Mamba uses the same environment and package specifications as Conda, but resolves dependencies and installs packages much faster.
Why Use Mamba?
- Speed: Mamba is significantly faster than Conda, especially for solving complex dependencies and installing large packages.
- Reliability: Mamba uses parallel downloading and a more efficient dependency resolver, reducing installation errors and timeouts.
- Compatibility: Mamba works seamlessly with existing Conda environments and packages. You can use
mambaandcondacommands interchangeably. - Community Support: Mamba is developed and maintained by the open-source community, with strong support from the conda-forge project.
Installing Mamba via Miniforge
Miniforge is a minimal installer for Conda and Mamba, maintained by conda-forge. It is recommended for Unix-like platforms (Linux, macOS, WSL) and comes with Mamba pre-installed.
Step 1: Download the Miniforge Installer
Open a terminal and download the installer appropriate for your system architecture. You can use wget:
Using wget:
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
Step 2: Run the Installer Script
Run the downloaded script to install Miniforge (and Mamba):
bash Miniforge3-$(uname)-$(uname -m).sh
Follow the prompts to complete the installation. By default, Miniforge will install to your home directory (e.g., ~/miniforge3).
Step 3: Initialize Conda
After installation, initialize Conda in your shell:
source ~/miniforge3/bin/activate
conda init
Restart your terminal to activate Conda automatically.
Using Mamba
Mamba is a drop-in replacement for Conda. Simply use mamba instead of conda for faster operations:
- Create a new environment:
mamba create -n myenv python=3.11 numpy pandas
- Activate an environment:
conda activate myenv
- Install packages:
mamba install scipy matplotlib
- Update packages:
mamba update --all
- List environments:
mamba env list
- Remove an environment:
mamba env remove -n myenv
Tips and Best Practices
- Always use the
conda-forgechannel for the latest, community-maintained packages.
Why Use conda-forge?
Using the conda-forge channel is important because it ensures all packages in your environment are built and maintained by the same community, following consistent standards. This greatly reduces the risk of dependency conflicts and broken environments that can occur when mixing packages from different channels. Conda-forge provides up-to-date versions, broad compatibility, and reliable builds for scientific and data science packages. By sticking to conda-forge, you make your environment more reproducible and robust.
- To update Mamba itself:
mamba update mamba
- For troubleshooting, use verbose mode:
mamba install <package> --verbose