Anaconda3 installation procedure placed installation in unexpected directory and conda commands don't work under Ubuntu focal 20

Viewed 432

I am using Ubuntu 20 focal and am having problems with the Anaconda installation process and operation. Using the file: Anaconda3-2020.07-Linux-x86_64.sh, and running via: sudo bash Anaconda3-2020.07-Linux-x86_64.sh I press ENTER after the welcome message, go through all the agreement messages and press yes that I agree, and then see the response:

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] >>> 

I then press ENTER, the installation takes place and now there is an installation at

$ sudo ls /root/
anaconda3

But, after this the commands expected to work do not,eg;

$ conda list
conda: command not found

I cannot use conda uninstall commands and wonder how the installation procedure should have taken place. The installation has not placed any files in ~/.

I have a Julia lang installation as well and there is a reference to it from an environments.txt file;

$ ls ~/.conda/
environments.txt
usr3@usr3:~$ ls ~/.conda/environments.txt 
.conda/environments.txt
usr3@usr3:~$ head ~/.conda/environments.txt 
/home/usr3/.julia/conda/3
usr3@usr3:~$ ls /home/usr3/.julia/conda/
3/       deps.jl  
usr3@usr3:~$ ls /home/usr3/.julia/conda/3/
bin/                         installer.sh
compiler_compat/             lib/
condabin/                    LICENSE.txt
conda-meta/                  pkgs/
condarc-julia.yml            share/
envs/                        shell/
etc/                         ssl/
include/                     x86_64-conda_cos6-linux-gnu/
1 Answers

The unexpected installation location in OP is likely due to running the installer with elevated privileges (sudo bash ...). Typically, only system administrators and others managing a multi-user install should require elevated privileges. The default install should not use sudo, which will instead result in installing somewhere under the user's home.

I haven't run the installer in a while, but I thought that it now includes an automatic run of conda init as part of the install. If not, please consult this answer with details on how to set up Conda's shell functionality (e.g., conda activate).

Related