liunx安装conda

在基于 Alibaba Cloud 提供的 Linux 操作系统上安装 Conda(一个开源包和环境管理系统)通常遵循类似于在其他 Linux 发行版上的安装步骤。以下是安装 Conda 的通用步骤:

1. 下载 Anaconda 或 Miniconda 安装脚本

您可以选择安装 Anaconda 或 Miniconda。Anaconda 包含了大量预安装的数据科学相关的包和工具,而 Miniconda 是一个更轻量级的版本,允许您按需安装包。

  • 访问 Anaconda 的下载页面:Anaconda Download
  • 或者,访问 Miniconda 的下载页面:Miniconda Download
  • 根据您的操作系统选择适当的安装程序(确保选择 Linux 版本)。

2. 在 Linux 上运行安装脚本

通过终端下载并运行安装脚本。以下示例使用 Miniconda:

  1. 下载安装脚本(以 Miniconda 为例):

    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    
  2. 运行安装脚本:

    bash Miniconda3-latest-Linux-x86_64.sh
    

3. 遵循安装过程

  • 在安装过程中,您将被提示阅读许可协议,输入安装位置,并选择是否将 Conda 添加到您的 PATH 环境变量。
  • 通常建议将 Conda 添加到您的 PATH。

4. 激活安装

  • 一旦安装完成,您可能需要运行以下命令来激活安装:
    source ~/.bashrc
    

5. 验证安装

  • 安装完成后,通过运行 conda --version 验证 Conda 是否已正确安装。

注意事项

  • 在 Alibaba Cloud 的 ECS 实例上进行此操作之前,请确保您有适当的权限,并且您的实例配置可以支持额外的软件安装。
  • 如果您使用的是非 root 用户进行安装,确保该用户具有安装软件的适当权限。

通过以上步骤,您应该能够在基于 Alibaba Cloud 的 Linux 系统上安装 Conda。这将使您能够管理 Python 环境和包,特别是对于数据科学和机器学习项目。

[root@cx-ms-test-1 opt]# wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
--2023-12-20 14:35:47--  https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving repo.anaconda.com (repo.anaconda.com)... 104.16.131.3, 104.16.130.3, 2606:4700::6810:8303, ...
Connecting to repo.anaconda.com (repo.anaconda.com)|104.16.131.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 141672045 (135M) [text/x-sh]
Saving to: ‘Miniconda3-latest-Linux-x86_64.sh’

Miniconda3-latest-Linux-x86_64.sh                   100%[=================================================================================================================>] 135.11M  3.48MB/s    in 31s     

2023-12-20 14:36:19 (4.36 MB/s) - ‘Miniconda3-latest-Linux-x86_64.sh’ saved [141672045/141672045]

[root@cx-ms-test-1 opt]# ls
Miniconda3-latest-Linux-x86_64.sh
[root@cx-ms-test-1 opt]# bash Miniconda3-latest-Linux-x86_64.sh

Welcome to Miniconda3 py311_23.11.0-1

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> ^C
[root@cx-ms-test-1 opt]# source ~/.bashrc
[root@cx-ms-test-1 opt]# conda --version
bash: conda: command not found
[root@cx-ms-test-1 opt]# source ~/.bashrc
[root@cx-ms-test-1 opt]# conda --version
bash: conda: command not found
[root@cx-ms-test-1 opt]# bash Miniconda3-latest-Linux-x86_64.sh

Welcome to Miniconda3 py311_23.11.0-1

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
======================================
End User License Agreement - Miniconda
======================================

Copyright 2015-2023, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:

This End User License Agreement (the "Agreement") is a legal agreement between you and Anaconda, Inc. ("Anaconda") and governs your use of Miniconda.

Subject to the terms of this Agreement, Anaconda hereby grants you a non-exclusive, non-transferable license to:

  * Install and use the Miniconda,
  * Modify and create derivative works of sample source code delivered in Miniconda subject to the Terms of Service for the Repository (as defined hereinafter) available at https://www.anaconda.com/terms-of
-service, and
  * Redistribute code files in source (if provided to you by Anaconda as source) and binary forms, with or without modification subject to the requirements set forth below.

Anaconda may, at its option, make available patches, workarounds or other updates to Miniconda. Unless the updates are provided with their separate governing terms, they are deemed part of Miniconda license
d to you as provided in this Agreement. This Agreement does not entitle you to any support for Miniconda.

Anaconda reserves all rights not expressly granted to you in this Agreement.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  * Neither the name of Anaconda nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

You acknowledge that, as between you and Anaconda, Anaconda owns all right, title, and interest, including all intellectual property rights, in and to Miniconda and, with respect to third-party products dis
tributed with or through Miniconda, the applicable third-party licensors own all right, title and interest, including all intellectual property rights, in and to such products. If you send or transmit any c
ommunications or materials to Anaconda suggesting or recommending changes to the software or documentation, including without limitation, new features or functionality relating thereto, or any comments, que
stions, suggestions or the like ("Feedback"), Anaconda is free to use such Feedback. You hereby assign to Anaconda all right, title, and interest in, and Anaconda is free to use, without any attribution or 
compensation to any party, any ideas, know-how, concepts, techniques or other intellectual property rights contained in the Feedback, for any purpose whatsoever, although Anaconda is not required to use any
 Feedback.

DISCLAIMER
==========

THIS SOFTWARE IS PROVIDED BY ANACONDA AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULA
R PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANACONDA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GO
ODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) AR
ISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TO THE MAXIMUM EXTENT PERMITTED BY LAW, ANACONDA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS OF USE, LOSS OF DATA OR LOSS
 OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF MINICONDA, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UP
ON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY. IN NO EVENT WILL THE TOTAL CUMULATIVE LIABILITY OF ANACONDA AND
 ITS AFFILIATES UNDER OR ARISING OUT OF THIS AGREEMENT EXCEED 10.00 U.S. DOLLARS.

Miscellaneous
=============

If you want to terminate this Agreement, you may do so by discontinuing use of Miniconda. Anaconda may, at any time, terminate this Agreement and the license granted hereunder if you fail to comply with any
 term of this Agreement. Upon any termination of this Agreement, you agree to promptly discontinue use of the Miniconda and destroy all copies in your possession or control. Upon any termination of this Agr
eement all provisions survive except for the licenses granted to you.

This Agreement is governed by and construed in accordance with the internal laws of the State of Texas without giving effect to any choice or conflict of law provision or rule that would require or permit t
he application of the laws of any jurisdiction other than those of the State of Texas. Any legal suit, action, or proceeding arising out of or related to this Agreement or the licenses granted hereunder by 
you must be instituted exclusively in the federal courts of the United States or the courts of the State of Texas in each case located in Travis County, Texas, and you irrevocably submit to the jurisdiction
 of such courts in any such suit, action, or proceeding.

Notice of Third Party Software Licenses
=======================================

Miniconda provides access to a repository (the "Repository") which contains software packages or tools licensed on an open source basis from third parties and binary packages of these third party tools. The
se third party software packages or tools are provided on an "as is" basis and are subject to their respective license agreements as well as this Agreement and the Terms of Service for the Repository locate
d at https://www.anaconda.com/terms-of-service; provided, however, no restriction contained in the Terms of Service shall be construed so as to limit Your ability to download the packages contained in Minic
onda provided you comply with the license for each such package. These licenses may be accessed from within the Miniconda software[1] or https://www.anaconda.com/legal. Information regarding which license i
s applicable is available from within many of the third party software packages and tools and at https://repo.anaconda.com/pkgs/main/ and https://repo.anaconda.com/pkgs/r/. Anaconda reserves the right, in i
ts sole discretion, to change which third party tools are included in the Repository accessible through Miniconda.


Intel Math Kernel Library
-------------------------

Miniconda provides access to re-distributable, run-time, shared-library files from the Intel Math Kernel Library ("MKL binaries").

Copyright 2018 Intel Corporation. License available at https://software.intel.com/en-us/license/intel-simplified-software-license (the "MKL License").

You may use and redistribute the MKL binaries, without modification, provided the following conditions are met:

  * Redistributions must reproduce the above copyright notice and the following terms of use in the MKL binaries and in the documentation and/or other materials provided with the distribution.
  * Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived from the MKL binaries without specific prior written permission.
  * No reverse engineering, decompilation, or disassembly of the MKL binaries is permitted.

You are specifically authorized to use and redistribute the MKL binaries with your installation of Miniconda subject to the terms set forth in the MKL License. You are also authorized to redistribute the MK
L binaries with Miniconda or in the Anaconda package that contains the MKL binaries. If needed, instructions for removing the MKL binaries after installation of Miniconda are available at https://docs.anaco
nda.com.

cuDNN Software
--------------

Miniconda also provides access to cuDNN software binaries ("cuDNN binaries") from NVIDIA Corporation. You are specifically authorized to use the cuDNN binaries with your installation of Miniconda subject to
 your compliance with the license agreement located at https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html. You are also authorized to redistribute the cuDNN binaries with an Miniconda package tha
t contains the cuDNN binaries. You can add or remove the cuDNN binaries utilizing the install and uninstall features in Miniconda.

cuDNN binaries contain source code provided by NVIDIA Corporation.

Arm Performance Libraries
-------------------------

Arm Performance Libraries (Free Version): Anaconda provides access to software and related documentation from the Arm Performance Libraries ("Arm PL") provided by Arm Limited. By installing or otherwise acc
essing the Arm PL, you acknowledge and agree that use and distribution of the Arm PL is subject to your compliance with the Arm PL end user license agreement located at: https://developer.arm.com/tools-and-
software/server-and-hpc/downloads/arm-performance-libraries/eula.

Export; Cryptography Notice
===========================

You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. Miniconda includes cryptograph
ic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software
, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See the Wassenaar Arrangement http:
//www.wassenaar.org/ for more information.

Anaconda has self-classified this software as Export Commodity Control Number (ECCN) EAR99, which includes mass market information security software using or performing cryptographic functions with asymmetr
ic algorithms. No license is required for export of this software to non-embargoed countries.

The Intel Math Kernel Library contained in Miniconda is classified by Intel as ECCN 5D992.c with no license required for export to non-embargoed countries.

The following packages listed on https://www.anaconda.com/cryptography are included in the Repository accessible through Miniconda that relate to cryptography.

Last updated March 21, 2022


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

Please answer 'yes' or 'no':'
>>> 


Please answer 'yes' or 'no':'
>>> Please answer 'yes' or 'no':'
>>> Please answer 'yes' or 'no':'
>>> Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 

Please answer 'yes' or 'no':'
>>> Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> yes

Miniconda3 will now be installed into this location:
/root/miniconda3

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

[/root/miniconda3] >>> 
PREFIX=/root/miniconda3
Unpacking payload ...
Extracting : jsonpatch-1.32-pyhd3eb1b0_0.conda:  47%|███████████��████████████████████████████████████████████▎                                                                | 34/73 [00:00<00:00, 58.75it/sExtracting : truststore-0.8.0-py311h06a4308_0.conda:  68%|█████████████████████████████████████████████████████████████████████████████��█▍                                    | 50/73 [00:01<00:01, 21.87it/sExtracting : libev-4.33-h7f8727e_1.conda:  73%|████████████████████████████████████████████████████████████████████████��███████████████████▏                                  | 53/73 [00:01<00:00, 21.87it/sExtracting : ld_impl_linux-64-2.38-h1181459_1.conda:  77%|█████████████████████████████████████████████████████████████��██████████████████████████▉                           | 56/73 [00:01<00:00, 21.87it/sExtracting : charset-normalizer-2.0.4-pyhd3eb1b0_0.conda:  81%|████████████████████████████████████████████████████��████████████████████████████████████▋                     | 59/73 [00:01<00:00, 21.87it/sExtracting : pyopenssl-23.2.0-py311h06a4308_0.conda:  85%|████████████████████████████████████████████���█████████████████████████████████████████████████████▌                 | 62/73 [00:01<00:00, 21.87it/Extracting : fmt-9.1.0-hdb19cb5_0.conda:  96%|█████████████████████████████████████████████��████████████████████████████████████████████████████████████████████████████▋     | 70/73 [00:01<00:00, 21.87it/sExtracting : idna-3.4-py311h06a4308_0.conda:  99%|██████████████████████████████████████████████████████████████████████████████████████████���███████████████████████████████▎ | 72/73 [00:01<00:00, 21.87it/                                                                                                                                                                                                              
Installing base environment...


Downloading and Extracting Packages:


Downloading and Extracting Packages:

Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
   run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> yes
no change     /root/miniconda3/condabin/conda
no change     /root/miniconda3/bin/conda
no change     /root/miniconda3/bin/conda-env
no change     /root/miniconda3/bin/activate
no change     /root/miniconda3/bin/deactivate
no change     /root/miniconda3/etc/profile.d/conda.sh
no change     /root/miniconda3/etc/fish/conf.d/conda.fish
no change     /root/miniconda3/shell/condabin/Conda.psm1
no change     /root/miniconda3/shell/condabin/conda-hook.ps1
no change     /root/miniconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change     /root/miniconda3/etc/profile.d/conda.csh
modified      /root/.bashrc

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

Thank you for installing Miniconda3!
[root@cx-ms-test-1 opt]# source ~/.bashrc
(base) [root@cx-ms-test-1 opt]# conda --version
conda 23.11.0

你可能感兴趣的:(conda)