Miniconda is a compact and complimentary installer for conda. It is an alternative to Anaconda, which comprises solely Python, Conda, and a handful of fundamental bundles.
Miniconda encompasses conda, Python, and a limited selection of packages that Python and conda rely on. Furthermore, it also incorporates a limited assortment of valuable packages such as Requests, PIPs, and numerous others. In this tutorial, we will show you how to install Miniconda on Ubuntu 22.04.
SSH root access or a regular system user with sudo privileges
Step 1. Log in via SSH
Let’s log in to your Ubuntu 22.04 VPS with SSH as a root user or as a regular user with sudo privileges.
ssh root@IP_Address -p Port_number
If you cannot log in as root, remember to replace “root” with a user that has sudo privileges. Additionally, replace the “IP_Address” and “Port_Number” with your server’s respective IP address and SSH port.
You can check whether you have the correct Ubuntu version installed on your server with the following command:
# lsb_release -a
You should get this output:
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
Let’s update the package index on our Ubuntu 22.04 system.
# apt update
Step 2. Download Miniconda Installer
The process is very simple; we need to download the installer script. We have to do this because Miniconda is not available in the default Ubuntu repository. So, let’s get it downloaded.
The Miniconda installer script has been downloaded and saved as /opt/miniconda-installer.sh
Step 3. Install Miniconda
The installation will be easy and straightforward. Simply execute the installer file.
# bash /opt/miniconda-installer.sh
Follow the instructions shown on the screen. We need to press ENTER to review the license agreement. Keep pressing ENTER or SPACE to finish it. , At the end of the agreement, you will be asked to accept the license terms or not. Type ‘yes’ to accept and continue.
Next, you will be shown this option below.
Miniconda3 will now be installed into this location:
/root/miniconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
Just press ENTER and continue.
Once the installation is finished, you will be prompted to start Miniconda or not.
Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no] [no] >>>
Type ‘yes’, then hit ENTER. You should see this as an output.
no change /root/miniconda3/condabin/conda
no change /root/miniconda3/bin/conda
no change /root/miniconda3/bin/conda-env
no change /root/miniconda3/bin/activate
no change /root/miniconda3/bin/deactivate
no change /root/miniconda3/etc/profile.d/conda.sh
no change /root/miniconda3/etc/fish/conf.d/conda.fish
no change /root/miniconda3/shell/condabin/Conda.psm1
no change /root/miniconda3/shell/condabin/conda-hook.ps1
no change /root/miniconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change /root/miniconda3/etc/profile.d/conda.csh
modified /root/.bashrc
==> For changes to take effect, close and re-open your current shell. <==
If you'd prefer that conda's base environment not be activated on startup,
set the auto_activate_base parameter to false:
conda config --set auto_activate_base false
Thank you for installing Miniconda3!
That’s it! You have just installed Miniconda.
Step 4. Configure Miniconda
After the Miniconda installation, we need to apply the changes made to ~/.bashrc file. Miniconda installer modified the file during the installation. Let’s execute the command.
# source ~/.bashrc
Now, at this point, you can run this command to check your Miniconda information.
# conda info
You will see this output:
active environment : base
active env location : /root/miniconda3
shell level : 1
user config file : /root/.condarc
populated config files :
conda version : 23.5.2
conda-build version : not installed
python version : 3.11.4.final.0
virtual packages : __archspec=1=x86_64
__glibc=2.35=0
__linux=5.15.0=0
__unix=0=0
base environment : /root/miniconda3 (writable)
conda av data dir : /root/miniconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /root/miniconda3/pkgs
/root/.conda/pkgs
envs directories : /root/miniconda3/envs
/root/.conda/envs
platform : linux-64
user-agent : conda/23.5.2 requests/2.29.0 CPython/3.11.4 Linux/5.15.0-76-generic ubuntu/22.04 glibc/2.35
UID:GID : 0:0
netrc file : None
offline mode : False
If you want to update Miniconda, you can run this command:
# conda update --all
If updates are available, it will show you a list of packages to update, and you need to answer with yes to proceed with the update.
Next, to exit from the conda environment, we can execute this command.
# conda deactivate
Congratulation! You have successfully installed Miniconda on Ubuntu 22.04
Of course, you don’t have to set up Miniconda on Ubuntu 20.04 if you use one of our Ubuntu VPS Hosting services, in which case you can simply ask our expert Linux admins to set up Miniconda on Ubuntu 20.04 VPS for you. They are available 24/7 and will take care of your request immediately.
PS. If you liked this post on how to set up Miniconda on Ubuntu 20.04, please share it with your friends on social networks or simply leave a reply in the comments section. Thanks.
1 thought on “How to Install Miniconda on Ubuntu 22.04”
This tutorial helped me to understand how conda works.
Thanks!
This tutorial helped me to understand how conda works.
Thanks!