In this tutorial, we want to show you to Set up or Install Anaconda on Rocky Linux 8.
Anaconda is an open-source distribution of the Python and R programming languages for data science that aims to simplify package management and deployment. Package versions in Anaconda are managed by the package management system, conda, which analyzes the current environment before executing an installation to avoid disrupting other frameworks and packages.
Steps To Set up Anaconda on Rocky Linux 8
To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Rocky Linux 8.
Install Python 3 on Rocky Linux 8
To install Anaconda, you need to install Python 3 on your server.
First, update your local package index with the command below:
sudo dnf update -y
Then, use the command below to install Python 3:
sudo dnf install python3 -y
Verify your Python installation by checking its version:
Output Python 3.6.8
Install Anaconda on Rocky Linux 8
First, you need to visit the Anaconda Downloads Page, and from the Linux section, copy the link address of the Anaconda installer.
Download Anaconda Installer
Then, use the wget command to download the Anaconda installer on Rocky Linux 8.
The file should be saved to the Downloads directory. Or you can choose the other locations.
sudo wget -P ~/Downloads https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh
At this point, switch to your Downloads directory:
Here you can verify Anaconda download integrity on Rocky Linux 8 with the command below:
In your output, you will see something similar to this:
Output e7ecbccbc197ebd7e1f211c59df2e37bc6959d081f2235d387e08c9026666acd 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.
From your Downloads directory, run the command below to install Anaconda on Rocky Linux 8:
sudo bash Anaconda3-2022.10-Linux-x86_64.sh
You will be asked to review the license agreement. Press Enter, then use Enter or the Spacebar to scroll through the agreement. In the end, type yes to agree to the license.
Also, you’ll be asked to confirm Anaconda’s installation directory. Use the default directory by pressing Enter.
Then, you will be asked to initialize Anaconda with conda init. Press yes and Enter.
When your installation is completed you will get the following output:
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
Note: Do not install in the /usr directory. When the installation finishes, this time, you won’t be prompted to initialize Anaconda. Instead, enter the following commands:
At this point, you need to reboot your server. After that you can verify your Anaconda installation on Rocky Linux 8 with the following command:
Output active environment : base active env location : /root/anaconda3 shell level : 1 user config file : /root/.condarc populated config files : conda version : 22.9.0 conda-build version : 3.22.0 python version : 3.9.13.final.0 virtual packages : __linux=4.18.0=0 __glibc=2.28=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/22.9.0 requests/2.28.1 CPython/3.9.13 Linux/4.18.0-425.10.1.el8_7.x86_64 rocky/8.7 glibc/2.28 UID:GID : 0:0 netrc file : None offline mode : False
Load Python Shell
At this point, you can load the Python programming shell by using the command below:
Your command prompt will change to this:
Python 3.9.13 (main, Aug 25 2022, 23:26:10) [GCC 11.2.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>>
To exit from the Python shell, run the command below:
Update Anaconda on Rocky Linux 8
To update your Anaconda service, you needed to first update the conda with the command below:
conda update conda
Conda is a package manager for the Anaconda Python environment. It’s always best to update your package manager before installing updates.
Then, use the following command to update Anaconda on Rocky Linux:
conda update anaconda
If you want to remove Anaconda from your Rocky Linux 8, you need to install the removal software with the command below:
conda install anaconda-clean
When your installation is completed, you can uninstall Anaconda from your server with the command below:
At this point, you have learned to Set up or Install Anaconda on Rocky Linux 8.
Hope you enjoy it.
Also, you may be interested in these articles: