Install Miniconda on Ubuntu 24.04 or 22.04 LTS Linux

Learn how to install MiniConda3 on Ubuntu 24.04 Noble or 22.04 LTS Jammy JellyFish to use the Conda package manager to install Anaconda Packages. 

The Anaconda distribution is a collection of software for scientific purposes. It includes a Python installation, an R installation, and the Conda package manager, which can be used to install Anaconda packages. Since the complete Anaconda distribution with all packages consumes a lot of storage space, there is also the variant known as Miniconda, which contains only Python, Conda, and a few basic packages. Both variants are entirely free and open source.

We need around 400 MB of free space to download and install MiniConda3.

Steps to install MiniConda3 on Ubuntu 24.04 or 22.04 LTS

Before following this tutorial, ensure you have Python installed on your Ubuntu system. However, it would be because Python version 3. x is already there on Ubuntu 24.04 or 22.04. If not, then you can use the APT package manager to install it; here is the command- sudo apt install python3

1. Update Ubuntu 24.04 or 22.04

Well, this step is not necessary to install MiniConda because we are going to use the official script for it. However, to ensure the system is up to date with available security updates for our Ubuntu 24.04 or 22.04, run the command once.

sudo apt update && sudo apt upgrade

 

2. Download MiniConda Script

MiniConda is not available to install using the APT package manager and standard repository of Ubuntu. Hence, we download the script published on Anaconda’s official document website. Here is the command to download it directly using the command terminal of Ubuntu 20.04.

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

 

3. Install MiniConda3 on Ubuntu 24.04 or 22.04

Now, we can install the MiniConda using the script for our current user.

bash Miniconda3-latest-Linux-x86_64.sh

Hit the Enter key to start the installation process. Soon, the installer will ask you to accept the License. Press q, and then type Yes to accept it.

Install Mini Conda on Ubuntu 22.04

The setup will also ask you – “Do you wish the installer to initialize Miniconda3 by running Conda init?If you type Yes, then every time you open the Terminal, Conda’s base environment will be activated on startup, and this will also add the Conda3 folder path in your bash profile. Hence, it is recommended to type –Yes

Those who don’t want it can type “No” and hit the Enter key.

Initialize Minianaconda

Refersh the current shell session

source ~/.bashrc

Trivia: In case you have activated the base environment of Condo to start every time with the terminal, and now you want to deactivate it, then here is the command to follow:

conda config --set auto_activate_base false

Close and reopen the terminal to start using the Conda package manager

 

4. Check Conda Version

Once the installation is completed, we can check the version of this Python package manager installed on our system.

conda --v

 

5. How to create a New Environment

Now, if you want to create an environment for your project with a particular Python version and libraries, here is how to do that.

conda create -n myfirstenv python

In the MiniConda, Python 3 is denoted or set as default Python.

Once created, you can activate the environment using the command:

conda activate myenv

Note: To deactivate the environment, use:

conda deactivate

 

6. Use Conda to install the library for Python

If you want to use the Conda package manager to install another package or library, here is the command syntax for that.

conda install package-name

For Example:

conda install numpy

 

7. How to update

To update the Conda package manager, you can use its command line:

conda update conda

 

7. Uninstall or Remove Miniconda3 – Ubuntu 24.04 or 22.04

To remove Miniconda3 from your Ubuntu 22.04, delete the folder containing its files. After that, remove it from your system’s $PATH as well.

rm -rf ~/miniconda3

Remove the Conda Initialize code from your bash profile.

nano ~/.bashrc

Find the lines shown in the screenshot and delete them.

Uninstall Miniconda3 Ubuntu 22.04

After that, save the file using Ctrl+O, hit the Enter key, and use Ctrl+X.

Close the Terminal and start it again, or simply source the Bash using:

source ~/.bashrc

 

Other Articles:

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.