How To Install Anaconda on Rocky Linux 9
In this tutorial, we will show you how to install Anaconda on Rocky Linux 9. For those of you who didn’t know, Anaconda is an open-source package manager and distribution of Python. It is used for scientific computing, data science, machine learning, and statistical analysis. The Anaconda environment includes over 250 data science packages automatically installed, and over 7,500 additional open-source packages that are compatible with Windows, macOS, and Linux.
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 Anaconda Python on Rocky Linux. 9.
Prerequisites
- A server running one of the following operating systems: Rocky Linux 9.
- 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).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Anaconda on Rocky Linux 9
Step 1. The first step is to update your system to the latest version of the package list. To do so, run the following commands:
sudo dnf check-update sudo dnf install dnf-utils
Step 2. Installing Python on Rocky Linux 9.
By default, Python is not available on Rocky Linux 9 base repository. Now run the following command below to download the latest stable version of Python from the official page to your system:
wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz
Next, extract the downloaded file:
tar xzf Python-3.10.6.tgz
Change to the decompressed directory to compile the source code:
cd Python-3.10.6 ./configure --enable-optimizations sudo make sudo make install
Once installed, you can counter-check the installed version of Python:
python3 --version
Step 3. Installing Anaconda on Rocky Linux 9.
By default, Anaconda is not available on Rocky Linux 9 base repository. Now we add download the latest version of the Anaconda installer script from the official website:
wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh
Now you can verify Anaconda download integrity on Rocky Linux 9 with the command below:
sha256sum Anaconda3-2022.10-Linux-x86_64.sh
You can compare this with the hashes on the Anaconda hashes web page. If the codes match, that means the software is authentic and ready to be used.
Once is done, run the command below to install Anaconda:
bash Anaconda3-2022.10-Linux-x86_64.sh
Output:
Thank you for installing Anaconda3! =========================================================================== Working with Python and Jupyter is a breeze in DataSpell. It is an IDE designed for exploratory data analysis and ML. Get better data insights with DataSpell. DataSpell for Anaconda is available at: https://www.anaconda.com/dataspell
Now, run the following command to activate the Anaconda:
source <anaconda_installation_location>/bin/activate conda init reboot
To verify the installation of Anaconda using the conda
, type the command below in your Terminal:
conda info
Output:
active environment : base active env location : /root/anaconda3 shell level : 1 user config file : /root/.condarc populated config files : conda version : 4.12.0 conda-build version : 3.28.8 python version : 3.10.6.final.0 virtual packages : __linux=5.14.0=0 __glibc=2.34=0 __unix=0=0 __archspec=1=x86_64 base environment : /root/anaconda3 (writable) conda av data dir : /root/anaconda3/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/anaconda3/pkgs /root/.conda/pkgs envs directories : /root/anaconda3/envs /root/.conda/envs platform : linux-64 user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.12 Linux/5.14.0-70.26.1.el9_0.x86_64 almalinux/9.0 glibc/2.34 UID:GID : 0:0 netrc file : None offline mode : False
You can also list all packages included in the Anaconda repository using the following command:
conda list
Congratulations! You have successfully installed Anaconda. Thanks for using this tutorial for installing Anaconda Python on your Rocky Linux 9 system. For additional help or useful information, we recommend you check the official Anaconda website.