We can install conda command on Ubuntu 20.04 / 18.04 using the anaconda. let’s see, how to install anaconda on ubuntu 20.04.
Anaconda is one of the most popular Data Science platform available in the market. This is open-source and requires the only python and R programming languages to run the anaconda and configure.
How To Install Anaconda Package Manager On Ubuntu 20.04 / 19.10
We have to update the ubuntu and install the curl command if it’s not present. you can run the below commands.
sudo apt update sudo apt upgrade -y sudo apt install curl -y
cd /opt sudo curl -O https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
Verify the download using the below commands.
sudo sha256sum Anaconda3-2020.07-Linux-x86_64.sh
You will see the output like:
Now, run the script using the bash command.
ubuntu@ubuntu:/opt$ sudo bash Anaconda3-2020.07-Linux-x86_64.sh Welcome to Anaconda3 2020.07 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>>
Press “Enter” to continue. it will ask you to select “yes” or “no” to accept the terms and conditions. you can also change the location of installation. It will take some time to get install.
Please answer 'yes' or 'no':' >>> yes Anaconda3 will now be installed into this location: /root/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/root/anaconda3] >>> /opt/lvmfolder/anaconda3 PREFIX=/opt/lvmfolder/anaconda3 Unpacking payload ...
After the installation finished, you can check the files at the location /opt/lvmfolder/anaconda as shown below.
Once the installation is finished, you will receive the following output:
installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] [no] >>> yes
It’s recommended to say “Yes” to use the conda command. you can find the path would be installed here at /root/.bashrc. if you have changed the installation directory path.
How To Solve “conda command not found on ubuntu”?
If you face the conda command not found while you have installed it on another directory or with the sudo permission. you can face this issue. To solve it, run the following commands.
sudo chown -R ubuntu:ubuntu /opt/lvmfolder/anaconda3/ ## change the owner from root to your user. export PATH=~/opt/lvmfolder/anaconda3/bin:$PATH ## export the path if not set. source ~/.bashrc ## update the source file
Once the above command is completed, you can check the conda command should be working.
(base) ubuntu@ubuntu:~$ conda --version conda 4.8.3
You can also check more information about the conda using the following commands. Use conda list or conda info command.
(base) ubuntu@ubuntu:~$ conda info active environment : base active env location : /opt/lvmfolder/anaconda3 shell level : 1 user config file : /home/ubuntu/.condarc populated config files : conda version : 4.8.3 conda-build version : 3.18.11 python version : 3.8.3.final.0 virtual packages : __glibc=2.31 base environment : /opt/lvmfolder/anaconda3 (writable) 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 : /opt/lvmfolder/anaconda3/pkgs /home/ubuntu/.conda/pkgs envs directories : /opt/lvmfolder/anaconda3/envs /home/ubuntu/.conda/envs platform : linux-64 user-agent : conda/4.8.3 requests/2.24.0 CPython/3.8.3 Linux/5.4.0-45-generic ubuntu/20.04.1 glibc/2.31 UID:GID : 1000:1000 netrc file : None offline mode : False
We’ve successfully installed the condo On Ubuntu 20.04. In a similar way, you can use the same procedure for another ubuntu distro like 18.04.
How To Update Conda On Ubuntu 20.04:
We can easily update the conda using the conda utility as you can see below. This will prompt you to proceed and press ‘y‘ then Enter.
conda update conda
Once the above task is completed. we need to update the anaconda package manager.
ubuntu@ubuntu:~/Desktop$ conda update anaconda Collecting package metadata (current_repodata.json): done Solving environment: done # All requested packages already installed.
That’s it. Conda install ubuntu anaconda 18.04