갈루아의 반서재

본 포스팅에서는 Ubuntu 20.04 서버에 파이썬 3.0 버전의 아나콘다를 설치하는 과정을 소개한다. 우분투 20.04의 코드네임은 Focal Fossa 이다. 

Installing Anaconda

아나콘다를 설치하는 가장 좋은 방법은 최신 버전의 Anaconda installer bash script 를 다운로드받아 검증 후 실행하는 것이다. 최신 버전은 Anaconda Downloads page 에서 다운로드받을 수 있다. 현재 시점의 가장 최신 버전은 2020.02 이다.

다음으로 /tmp 디렉토리로 이동한다.

fossa@fossa:~$ cd /tmp

curl 명령을 이용해서 아나콘다 웹사이트에서 복사한 링크를 붙여 다운로드하자. 그리고 빠른 사용을 위해 anaconda.sh 라는 파일로 아웃풋을 저장한다.

fossa@fossa:/tmp$ curl https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh --output anaconda.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  521M  100  521M    0     0   120M      0  0:00:04  0:00:04 --:--:--  120M
fossa@fossa:/tmp$ ls -al
-rw-rw-r--  1 fossa fossa 546910666 Jul  4 06:20 anaconda.sh

이제 SHA-256 체크섬이라는 cryptographic hash verification 을 통해 데이터를 검증한다. sha256sum 명령에 파일이름을 붙여서 사용할 것이다. 결과는 다음과 같을 것이다.

fossa@fossa:/tmp$ sha256sum anaconda.sh
2b9f088b2022edb474915d9f69a803d6449d5fdb4c303041f60ac4aefcc208bb  anaconda.sh

Anaconda with Python 3 on 64-bit Linux page 에서 검증결과를 대조해본다. 이제 설치를 위해 스크립트를 실행해보자.

fossa@fossa:/tmp$ bash anaconda.sh

Welcome to Anaconda3 2020.02

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>

ENTER 를 누르면 라이센스동의 화면으로 넘어간다. 

===================================
End User License Agreement - Anaconda Individual Edition
===================================

Copyright 2015-2020, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:



Do you accept the license terms> [yes|no]
>>> yes

yes 를 타이핑해서 동의를 하면, 이제 설치 위치를 정해야 한다. ENTER 를 눌러서 기본 위치에 설치할 수도 있고, 다른 위치를 지정할 수도 있다. 설치과정이 진행되고, 설치가 완료되면 다음과 같은 결과 화면을 볼 수 있다.

Anaconda3 will now be installed into this location:
/home/fossa/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/fossa/anaconda3] >>>
PREFIX=/home/fossa/anaconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

Preparing transaction: done
Executing transaction: done
installation finished.

다음으로 Anaconda3 를 초기화할 것인지를 선택한다. 

Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> yes
no change     /home/fossa/anaconda3/condabin/conda
no change     /home/fossa/anaconda3/bin/conda
no change     /home/fossa/anaconda3/bin/conda-env
no change     /home/fossa/anaconda3/bin/activate
no change     /home/fossa/anaconda3/bin/deactivate
no change     /home/fossa/anaconda3/etc/profile.d/conda.sh
no change     /home/fossa/anaconda3/etc/fish/conf.d/conda.fish
no change     /home/fossa/anaconda3/shell/condabin/Conda.psm1
no change     /home/fossa/anaconda3/shell/condabin/conda-hook.ps1
no change     /home/fossa/anaconda3/lib/python3.7/site-packages/xontrib/conda.xsh
no change     /home/fossa/anaconda3/etc/profile.d/conda.csh
modified      /home/fossa/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

If you'd prefer that conda's base environment not be activated on startup,
   set the auto_activate_base parameter to false:

conda config --set auto_activate_base false

Thank you for installing Anaconda3!

===========================================================================

Anaconda and JetBrains are working together to bring you Anaconda-powered
environments tightly integrated in the PyCharm IDE.

PyCharm for Anaconda is available at:
https://www.anaconda.com/pycharm

이제 ~/.bashrc 를 소싱하여 활성화시킨다. 그러면 아나콘다의 기본 프로그래밍 환경으로 변경되며, 명령 프롬프트가 다음과 같이 바뀌게 된다. 

fossa@fossa:/tmp$ source ~/.bashrc
(base) fossa@fossa:/tmp$

물론 아나콘다에 이런 디폴트 기본 프로그래밍 환경이 존재하지만, 실제로는 각각의 필요에 따른 고립된 환경을 직접 생성해야 한다. 다음과 같은 conda 명령을 실행시켜봄으로써 아나콘다가 제대로 설치되었는지 확인할 수도 있다. conda list 명령의 경우 아나콘다 설치를 통해 사용가능한 모든 패키지 목록을 보여준다.

(base) fossa@fossa:/$ conda list
# packages in environment at /home/fossa/anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0
_libgcc_mutex             0.1                        main
alabaster                 0.7.12                   py37_0
anaconda                  2020.02                  py37_0
anaconda-client           1.7.2                    py37_0
anaconda-navigator        1.9.12                   py37_0
anaconda-project          0.8.4                      py_0
argh                      0.26.2                   py37_0
asn1crypto                1.3.0                    py37_0
astroid                   2.3.3                    py37_0
astropy                   4.0              py37h7b6447c_0
atomicwrites              1.3.0                    py37_1
attrs                     19.3.0                     py_0
autopep8                  1.4.4                      py_0
babel                     2.8.0                      py_0
............

이제 아나콘다 설치는 끝났고, 환경설정을 진행해보자.

 

Setting Up Anaconda Environments

아나콘다 가상 환경은 파이썬 버전이나 필요한 패키지 별로 프로젝트 관리가 가능하게 해준다. 파이썬 버전을 지정하여 각각의 필요한 아나콘다 환경을 구축할 수 있다. 먼저 가능한 파이썬 버전부터 살펴보자.

(base) fossa@fossa:/$ conda search "^python$"
Loading channels: done
# Name                       Version           Build  Channel
python                        2.7.13     hac47a24_15  pkgs/main
python                        2.7.13     heccc3f1_16  pkgs/main
python                        2.7.13     hfff3488_13  pkgs/main
python                        2.7.14     h1571d57_29  pkgs/main
python                        2.7.14     h1571d57_30  pkgs/main
python                        2.7.14     h1571d57_31  pkgs/main
python                        2.7.14     h1aa7481_19  pkgs/main
python                        2.7.14     h435b27a_18  pkgs/main
python                        2.7.14     h89e7a4a_22  pkgs/main
python                        2.7.14     h91f54f5_26  pkgs/main
python                        2.7.14     h931c8b0_15  pkgs/main
python                        2.7.14     h9b67528_20  pkgs/main
python                        2.7.14     ha6fc286_23  pkgs/main
python                        2.7.14     hc2b0042_21  pkgs/main
python                        2.7.14     hdd48546_24  pkgs/main
python                        2.7.14     hf918d8d_16  pkgs/main
python                        2.7.15      h1571d57_0  pkgs/main
python                        2.7.15      h77bded6_1  pkgs/main
python                        2.7.15      h77bded6_2  pkgs/main
python                        2.7.15      h9bab390_2  pkgs/main
python                        2.7.15      h9bab390_4  pkgs/main
python                        2.7.15      h9bab390_6  pkgs/main
python                        2.7.16      h8b3fad2_1  pkgs/main
python                        2.7.16      h8b3fad2_2  pkgs/main
python                        2.7.16      h8b3fad2_3  pkgs/main
python                        2.7.16      h8b3fad2_4  pkgs/main
python                        2.7.16      h8b3fad2_5  pkgs/main
python                        2.7.16      h9bab390_0  pkgs/main
python                        2.7.16      h9bab390_6  pkgs/main
python                        2.7.16      h9bab390_7  pkgs/main
python                        2.7.17      h9bab390_0  pkgs/main
python                        2.7.18      h02575d3_0  pkgs/main
python                        2.7.18      h15b4118_1  pkgs/main
python                         3.5.4     h00c01ad_19  pkgs/main
python                         3.5.4     h0b4c808_22  pkgs/main
python                         3.5.4     h2170f06_12  pkgs/main
python                         3.5.4     h3075507_18  pkgs/main
python                         3.5.4     h417fded_24  pkgs/main
python                         3.5.4     h56e0582_23  pkgs/main
python                         3.5.4     h72f0b78_15  pkgs/main
python                         3.5.4     hb43c6bb_21  pkgs/main
python                         3.5.4     hc053d89_14  pkgs/main
python                         3.5.4     hc3d631a_27  pkgs/main
python                         3.5.4     he2c66cf_20  pkgs/main
python                         3.5.5      hc3d631a_0  pkgs/main
python                         3.5.5      hc3d631a_1  pkgs/main
python                         3.5.5      hc3d631a_3  pkgs/main
python                         3.5.5      hc3d631a_4  pkgs/main
python                         3.5.6      hc3d631a_0  pkgs/main
python                         3.6.2     h02fb82a_12  pkgs/main
python                         3.6.2     h0b30769_14  pkgs/main
python                         3.6.2     h33255ae_18  pkgs/main
python                         3.6.2     hca45abc_19  pkgs/main
python                         3.6.2     hdfe5801_15  pkgs/main
python                         3.6.3      h0ef2715_3  pkgs/main
python                         3.6.3      h1284df2_4  pkgs/main
python                         3.6.3      h6c0c0dc_5  pkgs/main
python                         3.6.3      hc9025b9_1  pkgs/main
python                         3.6.3      hcad60d5_0  pkgs/main
python                         3.6.3      hefd0734_2  pkgs/main
python                         3.6.4      hc3d631a_0  pkgs/main
python                         3.6.4      hc3d631a_1  pkgs/main
python                         3.6.4      hc3d631a_3  pkgs/main
python                         3.6.5      hc3d631a_0  pkgs/main
python                         3.6.5      hc3d631a_1  pkgs/main
python                         3.6.5      hc3d631a_2  pkgs/main
python                         3.6.6      h6e4f718_2  pkgs/main
python                         3.6.6      hc3d631a_0  pkgs/main
python                         3.6.7      h0371630_0  pkgs/main
python                         3.6.8      h0371630_0  pkgs/main
python                         3.6.9      h265db76_0  pkgs/main
python                        3.6.10      h0371630_0  pkgs/main
python                        3.6.10      h191fe78_1  pkgs/main
python                        3.6.10      h7579374_2  pkgs/main
python                        3.6.10      hcf32534_1  pkgs/main
python                         3.7.0      h6e4f718_3  pkgs/main
python                         3.7.0      hc3d631a_0  pkgs/main
python                         3.7.1      h0371630_3  pkgs/main
python                         3.7.1      h0371630_7  pkgs/main
python                         3.7.2      h0371630_0  pkgs/main
python                         3.7.3      h0371630_0  pkgs/main
python                         3.7.4      h265db76_0  pkgs/main
python                         3.7.4      h265db76_1  pkgs/main
python                         3.7.5      h0371630_0  pkgs/main
python                         3.7.6      h0371630_2  pkgs/main
python                         3.7.7 h191fe78_0_cpython  pkgs/main
python                         3.7.7 hcf32534_0_cpython  pkgs/main
python                         3.7.7      hcff3b4d_4  pkgs/main
python                         3.7.7      hcff3b4d_5  pkgs/main
python                         3.8.0      h0371630_0  pkgs/main
python                         3.8.0      h0371630_1  pkgs/main
python                         3.8.0      h0371630_2  pkgs/main
python                         3.8.1      h0371630_1  pkgs/main
python                         3.8.2      h191fe78_0  pkgs/main
python                         3.8.2      hcf32534_0  pkgs/main
python                         3.8.2     hcff3b4d_13  pkgs/main
python                         3.8.2     hcff3b4d_14  pkgs/main
python                         3.8.3      hcff3b4d_0  pkgs/main
python                         3.8.3      hcff3b4d_2  pkgs/main

파이썬 3 와 파이썬 2 버전을 포함한 목표로 삼을 수 있는 다양한 파이썬 버전을 결과로 보여준다. 여기서는 파이썬 3를 사용할 것이므로, 다음과 같이 가장 최신 버전의 파이썬 3 버전을 사용하여 환경을 구성해보자. 

(base) fossa@fossa:~$ conda create --name quintic python=3
Collecting package metadata (current_repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.8.2
  latest version: 4.8.3

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /home/fossa/anaconda3/envs/quintic

  added / updated specs:
    - python=3


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2020.6.24  |                0         125 KB
    certifi-2020.6.20          |           py38_0         156 KB
    libedit-3.1.20191231       |       h7b6447c_0         167 KB
    libffi-3.3                 |       he6710b0_1          50 KB
    ncurses-6.2                |       he6710b0_1         817 KB
    openssl-1.1.1g             |       h7b6447c_0         2.5 MB
    pip-20.1.1                 |           py38_1         1.7 MB
    python-3.8.3               |       hcff3b4d_2        49.1 MB
    readline-8.0               |       h7b6447c_0         356 KB
    setuptools-47.3.1          |           py38_0         515 KB
    sqlite-3.32.3              |       h62c20be_0         1.1 MB
    tk-8.6.10                  |       hbc83047_0         3.0 MB
    wheel-0.34.2               |           py38_0          51 KB
    xz-5.2.5                   |       h7b6447c_0         341 KB
    ------------------------------------------------------------
                                           Total:        59.9 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  ca-certificates    pkgs/main/linux-64::ca-certificates-2020.6.24-0
  certifi            pkgs/main/linux-64::certifi-2020.6.20-py38_0
  ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.33.1-h53a641e_7
  libedit            pkgs/main/linux-64::libedit-3.1.20191231-h7b6447c_0
  libffi             pkgs/main/linux-64::libffi-3.3-he6710b0_1
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0
  ncurses            pkgs/main/linux-64::ncurses-6.2-he6710b0_1
  openssl            pkgs/main/linux-64::openssl-1.1.1g-h7b6447c_0
  pip                pkgs/main/linux-64::pip-20.1.1-py38_1
  python             pkgs/main/linux-64::python-3.8.3-hcff3b4d_2
  readline           pkgs/main/linux-64::readline-8.0-h7b6447c_0
  setuptools         pkgs/main/linux-64::setuptools-47.3.1-py38_0
  sqlite             pkgs/main/linux-64::sqlite-3.32.3-h62c20be_0
  tk                 pkgs/main/linux-64::tk-8.6.10-hbc83047_0
  wheel              pkgs/main/linux-64::wheel-0.34.2-py38_0
  xz                 pkgs/main/linux-64::xz-5.2.5-h7b6447c_0
  zlib               pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3


Proceed ([y]/n)? y


Downloading and Extracting Packages
xz-5.2.5             | 341 KB    | #################################################################### | 100%
python-3.8.3         | 49.1 MB   | #################################################################### | 100%
pip-20.1.1           | 1.7 MB    | #################################################################### | 100%
tk-8.6.10            | 3.0 MB    | #################################################################### | 100%
libffi-3.3           | 50 KB     | #################################################################### | 100%
sqlite-3.32.3        | 1.1 MB    | #################################################################### | 100%
ca-certificates-2020 | 125 KB    | #################################################################### | 100%
ncurses-6.2          | 817 KB    | #################################################################### | 100%
openssl-1.1.1g       | 2.5 MB    | #################################################################### | 100%
certifi-2020.6.20    | 156 KB    | #################################################################### | 100%
readline-8.0         | 356 KB    | #################################################################### | 100%
libedit-3.1.20191231 | 167 KB    | #################################################################### | 100%
wheel-0.34.2         | 51 KB     | #################################################################### | 100%
setuptools-47.3.1    | 515 KB    | #################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate quintic
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) fossa@fossa:~$

어떤 패키지가 다운로드되고 설치되는지에 대한 정보를 함께 보여주고, 설치를 진행할 것인지를 물어본다. 설치가 끝나면 다음과 같이 해당 아나콘다 환경을 활성화할 수 있다. 

(base) fossa@fossa:~$ conda activate quintic
(quintic) fossa@fossa:~$

환경이 활성화되면 명령 프로픔트의 앞부분을 보면, 방금 생성하고 활성화한 환경으로 변경되었음을 알 수 있다. 그러면 그 환경에 설치된 파이썬 버전을 확인해보자. 

(quintic) fossa@fossa:~$ python --version
Python 3.8.3

비활성화는 다음과 같이 할 수 있다.

(quintic) fossa@fossa:~$ conda deactivate
(base) fossa@fossa:~$

다음과 같이 파이썬 인수로 버전을 지정하여 특정 파이썬 버전의 환경구축도 가능하다.

(base) fossa@fossa:~$ conda create -n my_env35 python=3.5

현재 구축된 아나콘다 환경 리스트는 다음과 같이 조회가능하다. 여기서 asterisk(*) 은 현재 활성화된 환경을 나타낸다.

(base) fossa@fossa:~$ conda info --envs
# conda environments:
#
base                  *  /home/fossa/anaconda3
quintic                  /home/fossa/anaconda3/envs/quintic

 각각의 환경은 다음과 같은 기본 패키지를 포함하고 있다.

  • _libgcc_mutex
  • ca-certificates
  • certifi
  • libedit
  • libffi
  • libgcc-ng
  • libstdcxx-ng
  • ncurses
  • openssl
  • pip
  • python
  • readline
  • setuptools
  • sqlite
  • tk
  • wheel
  • xz
  • zlib

여기에 추가적인 패키지 설치가 가능한데, 예를 들면 다음과 같이 numpy 패키지를 설치할 수 있다.

(base) fossa@fossa:~$ conda install --name my_env35 numpy

그리고 아예 가상환경 구축시부터 numpy 패키지를 포함하여 설치할 수도 있다.

(base) fossa@fossa:~$ conda create --name my_env python=3 numpy

설치된 아나콘다 가상환경은 다음과 같이 제거할 수 있다.

(base) fossa@fossa:~$ conda remove --name my_env35 --all

다시 conda info --envs 명령을 실행시켜보면, 해당 환경이 제거되었음을 알 수 있다.

 

Updating Anaconda

정기적으로 아나콘다를 최신 버전으로 업데이트할 필요가 있다. 이를 위해 먼저 conda 유틸리티를 업데이트해야한다.

(base) fossa@fossa:~$ conda update conda
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/fossa/anaconda3

  added / updated specs:
    - conda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-4.8.3                |           py37_0         2.8 MB
    conda-package-handling-1.6.1|   py37h7b6447c_0         798 KB
    ------------------------------------------------------------
                                           Total:         3.6 MB

The following packages will be UPDATED:

  conda                                        4.8.2-py37_0 --> 4.8.3-py37_0
  conda-package-han~                   1.6.0-py37h7b6447c_0 --> 1.6.1-py37h7b6447c_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
conda-package-handli | 798 KB    | #################################################################### | 100%
conda-4.8.3          | 2.8 MB    | #################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) fossa@fossa:~$

conda 업데이트가 끝나면, 이제 아나콘다 배포판을 업데이트할 차례이다.

(base) fossa@fossa:~$ conda update anaconda
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/fossa/anaconda3

  added / updated specs:
    - anaconda


The following packages will be downloaded:

이제 최신 버전의 conda 와 Anaconda 를 사용할 수 있다.

 

Uninstalling Anaconda

가상환경이 아니라 아나콘다 자체를 더 이상 사용할 일이 없어 제거할 때는 다음과 같이 하면 된다. 먼저 이를 도와줄 anaconda-clean 모듈을 설치해야한다. anaconda-clean 모듈은 아나콘다 제거를 위한 환경파일을 제거해준다.

(base) fossa@fossa:~$ conda install anaconda-clean
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/fossa/anaconda3

  added / updated specs:
    - anaconda-clean


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    anaconda-clean-1.1.0       |           py37_1           7 KB
    ------------------------------------------------------------
                                           Total:           7 KB

The following NEW packages will be INSTALLED:

  anaconda-clean     pkgs/main/linux-64::anaconda-clean-1.1.0-py37_1


Proceed ([y]/n)? y


Downloading and Extracting Packages
anaconda-clean-1.1.0 | 7 KB      | ############################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

해당 모듈 설치가 끝나면, 다음과 같이 각각을 제거하거나, --yes 를 명령끝에 붙여서 한 번에 제거할 수도 있다.

(base) fossa@fossa:~$ anaconda-clean
Delete .conda? (y/n):

이 과정에서는 다음과 같이 홈디렉토리에 .anaconda_backup 라는 백업폴더가 생성된다. 

(base) fossa@fossa:~$ anaconda-clean --yes
Backup directory: /home/fossa/.anaconda_backup/2020-07-04T071322
(base) fossa@fossa:~$ ls -al
total 44
drwxr-xr-x  7 fossa fossa 4096 Jul  4 07:13 .
drwxr-xr-x  5 root  root  4096 Jul  4 06:14 ..
drwxrwxr-x  3 fossa fossa 4096 Jul  4 07:13 .anaconda_backup
-rw-r--r--  1 fossa fossa  220 Feb 25 12:03 .bash_logout
-rw-r--r--  1 fossa fossa 4246 Jul  4 06:26 .bashrc
drwx------  2 fossa fossa 4096 Jul  4 06:15 .cache
drwxrwxr-x  2 fossa fossa 4096 Jul  4 07:00 .empty
-rw-r--r--  1 fossa fossa  807 Feb 25 12:03 .profile
drwx------  2 fossa fossa 4096 Jul  4 06:14 .ssh
drwxrwxr-x 27 fossa fossa 4096 Jul  4 07:11 anaconda3
(base) fossa@fossa:~$

이제 다음과 같이 아나콘다 디렉토리 전체를 삭제할 수 있다.

(base) fossa@fossa:~$ rm -rf ~/anaconda3
(base) fossa@fossa:~$ ls -al
total 40
drwxr-xr-x 6 fossa fossa 4096 Jul  4 07:14 .
drwxr-xr-x 5 root  root  4096 Jul  4 06:14 ..
drwxrwxr-x 3 fossa fossa 4096 Jul  4 07:13 .anaconda_backup
-rw-r--r-- 1 fossa fossa  220 Feb 25 12:03 .bash_logout
-rw-r--r-- 1 fossa fossa 4246 Jul  4 06:26 .bashrc
drwx------ 2 fossa fossa 4096 Jul  4 06:15 .cache
drwxrwxr-x 2 fossa fossa 4096 Jul  4 07:00 .empty
-rw-r--r-- 1 fossa fossa  807 Feb 25 12:03 .profile
drwx------ 2 fossa fossa 4096 Jul  4 06:14 .ssh

마지막으로 .bashrc 파일의 PATH 라인을 삭제한다. 다음과 같이 nano 와 같은 텍스트 편집기를 연다. 스크롤을 내리거나 CTRL + W 을 통해 아나콘다 블럭을 찾아 코멘트 아웃 또는 삭제한다.

 

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

편집이 끝나면 CTRL + X 로 나오고, y 를 눌러 변경사항을 저장한다. 이로써 아나콘다는 완전히 삭제되었다.