UbuntuUbuntu Based

How To Install Miniconda on Ubuntu 24.04 LTS

Install Miniconda on Ubuntu 24.04

In this tutorial, we will show you how to install Miniconda on Ubuntu 24.04 LTS. Conda is an open-source package management system and environment management system that runs on Windows, macOS, and Linux. It was created by Continuum Analytics (now Anaconda, Inc.) to simplify package management and deployment for data science and machine learning applications. Conda allows users to create isolated environments, each with its own set of packages and dependencies, making it easier to work on multiple projects without conflicts.

 Unlike other package managers like Pip, Conda is not limited to Python packages. It can manage packages and dependencies for any language, including R, Ruby, and Scala. This versatility makes Conda a preferred choice for data scientists and researchers who work with diverse programming languages and libraries.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Git on Ubuntu 24.04 (Noble Numbat). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.

Prerequisites

  • A server running one of the following operating systems: Ubuntu and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
  • An Ubuntu 24.04 system with root access or a user with sudo privileges.

Install Miniconda on Ubuntu 24.04 LTS Noble Numbat

Step 1. Updating the Package Repository.

It’s crucial to keep your system up-to-date to avoid potential compatibility issues and security vulnerabilities. Open your terminal and run the following commands to update the package lists and upgrade installed packages:

sudo apt update

This command will fetch the latest package information from the Ubuntu repositories, allowing you to install the most recent version of Miniconda and its dependencies. Updating the package repository is crucial to maintaining the security and stability of your system.

Step 2. Installing Miniconda on Ubuntu 24.04.

Visit the official Conda website to download the installer for either Miniconda or Anaconda, depending on your choice. Ensure you select the installer compatible with Linux.

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

Once the download is complete, you can start the installation process. Make the installer script executable by running the following command:

chmod +x Miniconda3-latest-Linux-x86_64.sh

Now, run the installer script:

./Miniconda3-latest-Linux-x86_64.sh

The installer will display a license agreement. Press Enter to view the agreement, and once you’ve reached the end, type yes to agree. Next, you’ll be prompted to choose the installation location. You can press Enter to accept the default or specify a different location.

Next, the installer will ask you to specify the installation location. Press “Enter” to accept the default location (/home/your_username/miniconda3) or provide a custom path if desired.

The installer will then proceed to install Miniconda. This process may take a few minutes, depending on your system’s speed and internet connection.

Step 3. Configuring Conda.

After installing Miniconda, you can customize its configuration to suit your needs. The Conda configuration file (.condarc) allows you to set various options, such as the default environment location, package channels, and proxy settings.

To create or modify the .condarc file, open a terminal and run the following command:

conda config --add channels conda-forge

This command adds the conda-forge channel to your Conda configuration. The conda-forge channel is a community-driven repository that provides a wide range of packages and dependencies.

You can also set other configuration options, such as the default environment location, by modifying the .condarc file directly. To open the file in a text editor, run:

nano ~/.condarc

Step 4. Creating and Managing Conda Environments.

One of the key features of Conda is its ability to create and manage isolated environments. Each environment can have its own set of packages and dependencies, allowing you to work on multiple projects without conflicts.

To create a new Conda environment, use the following command:

conda create --name myenv python=3.9

Replace myenv with your desired environment name and 3.9 with the Python version you want to use.

To activate the newly created environment, run:

conda activate myenv

Once activated, you can install packages specific to this environment using the conda install command:

conda install numpy pandas matplotlib

To deactivate the environment and return to the base environment, use:

conda deactivate

It’s a good practice to create separate environments for different projects to keep their dependencies isolated. You can easily switch between environments using the conda activate and conda deactivate commands.

Congratulations! You have successfully installed Miniconda. Thanks for using this tutorial for installing Miniconda on the Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the Miniconda website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button