How to Install Anaconda on Ubuntu 20.04
Anaconda is a distribution of Python and R that is used for data science, Machine learning and Scientific analysis. It is designed to simplify the process of managing several complex software environments and packages required for data scientists. It offers several libraries and packages required for data analysis and data processing. Due to advancements in AI and machine learning, Anaconda become more popular among users.
In this article, we will guide you through the steps to install Anaconda on Ubuntu 20.04. Even though this article is based on installing Anaconda on Ubuntu 20.04, it is also applicable to other versions of Ubuntu as the installation process is the same.
Install Anaconda on Ubuntu
The steps to install the Anaconda distribution on the Ubuntu system are explained in detail below:
Step 1: Download Anaconda distribution
Visit the official website of Anaconda distribution and download the latest version of Anaconda distribution installer for Ubuntu.
Step 2: Open the terminal
Open the terminal by pressing “Ctrl+Alt+T” or by clicking the terminal icon from the applications menu.
Step 3: Navigate to downloads
Change the working directory of the terminal by executing the below command. You can also view the files in downloads using the ‘ls’ command. You can now see the Anaconda distribution installer in Downloads.
cd Dowloads
Step 4: Run the installer
After changing the directory to Downloads, run the Anaconda installer by executing the following command.
bash Anaconda3-2024.02-1-Linux-x86_64.sh
Step 5: Review the license agreement
Now, the Anaconda installer will ask the user to review the license agreement. Press “Enter” to review the license agreement.
Step 6: Accept license terms
After reading the license terms, the installer will ask whether you accept the license agreement. Type ‘yes’ and press ‘Enter’ to accept the agreement and continue the installation.
Step 7: Specify the installation location
After accepting the license agreement, the installer will ask for the installation folder for Anaconda distribution. You can press ‘Enter’ to install in the default location or you can specify your desired location. Then installer will start unpacking packages and install them. Installation may take some time.
Step 8: Initialize Anaconda
After installing Anaconda, the installer will ask the user to initialize the conda. You can type yes and press ‘Enter’ to initialize Anaconda and finish installation. It will add the ‘conda’ tool to the system path, so users can run it from any directory.
Now installation is complete and to activate Anaconda, just close the terminal and reopen it.
Step 9: Verify installation
Run ‘conda info’ in the newly opened shell to verify that the Anaconda distribution is installed properly. It will display the details of installation if it is installed successfully.
conda info
Updating Anaconda
It is very important to keep the Anaconda updated to the latest version when new versions are released. It is pretty simple to update Anaconda packages. The steps to update Anaconda are given below:
Step 1: Run conda update command
To update Anaconda, run the following command in the terminal.
conda update --all
Step 2: Confirm updates
It will display a list of updates to your current installation and ask whether to proceed or cancel the update. Type ‘y’ and press ‘Enter’ to update it.
It is highly recommended to keep all the packages updated to the latest versions.
Uninstall Anaconda on Ubuntu
The steps to uninstall the Anaconda distribution from Ubuntu are given below:
Step 1: Execute the remove command
To uninstall Anaconda from your Ubuntu system, run the following command. It will remove all the files related to Anaconda.
rm -rf ~/anaconda3 ~/.condarc ~/.conda ~/.continuum
Step 2: Open bashrc file
Now to remove Anaconda from the system path, open ‘bashrc’ on gedit using the following command.
gedit ~/.bashrc
Step 3: Remove Anaconda from path
Scroll down to the end of the bashrc file and locate the contents related to the Anaconda installation. Select those parts and delete them to remove conda from the path.
Step 4: Save the bashrc file
After deleting the selected contents, click on the save on top part of gedit or press “Ctrl+S” to save the edited bash file.
Now you have successfully uninstalled Anaconda and also removed it from the path.
Conclusion
Anaconda is widely used by data scientists and researchers for data processing, machine learning, predictive analysis and data visualisation. It is a great tool to have for developers as it helps data scientists and developers easily manage multiple packages and virtual environments. In this tutorial, we have explained the steps to install Anaconda on Ubuntu, how to update Anaconda and finally the steps to uninstall Anaconda from Ubuntu. We hope that you have successfully installed Anaconda on your system following our tutorial and started your projects on data science. Feel free to share your thoughts about us in the comments!
Contact Us