Anaconda is a great package manager to manage Python and R environment. The instructions in this post will work for Anaconda installation on Ubuntu. If you want to install Anaconda on Centos, check out below link...

how to install python 3.5 python 3.7 and anaconda on centos

Install Anaconda

If you are installing Anaconda on a system which has GUI desktop interface available. Then you should also enable QT base Anaconda navigator. To do that install following packages first...

sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6

Let us download the bash installation script now...


For any latest versions of Anaconda, keep an eye on following link...

Install Anaconda now...


After running above command, the script will walk you through few prompts which are all self-explanatory.  Note the last prompt will ask you whether to run conda init, choose "yes"

Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]

Now do...

source ~/.bashrc

Now you can access Conda. To test that do ...

conda --help

If above command is successful, that means Anaconda is installed successfully.

Uninstall Anaconda

To uninstall Anaconda, just run the following "rm" command.

rm -rf ~/anaconda3 ~/.condarc ~/.conda ~/.continuum

Also remove the following block of code from ~/.bashrc file

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
    if [ -f "/home/anaconda3/etc/profile.d/" ]; then
        . "/home/anaconda3/etc/profile.d/"
        export PATH="/home/anaconda3/bin:$PATH"
unset __conda_setup
# <<< conda initialize <<<