This topic describes how to install Alibaba Cloud CLI on Linux.
Procedure
You can use the following methods to install Alibaba Cloud CLI on Linux:
Use a Bash script
Alibaba Cloud CLI provides a script for quick installation. The following example shows how to quickly install Alibaba Cloud CLI.
Install the latest version of Alibaba Cloud CLI
If you do not specify a version, the script automatically obtains and installs the latest version of Alibaba Cloud CLI.
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"
Install an earlier version of Alibaba Cloud CLI
You can configure the
-V
option to specify the version of Alibaba Cloud CLI that you want to install. To view Alibaba Cloud CLI versions, visit GitHub Release./bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)" -- -V 3.0.277
Query installation notes
You can configure the
-h
option to query the installation nodes of Alibaba Cloud CLI on your machine./bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)" -- -h
Use a TGZ file
The following method shows how to download the TGZ file.
Download the latest TGZ file:
NoteYou can run the
uname -m
command to check the current Linux system architecture.arm64
oraarch64
indicates that the system architecture is ARM64. Other responses indicate that the system architecture is AMD64.Run the following command to install the latest installation package for Linux AMD64:
curl https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz -o aliyun-cli-linux-latest.tgz
Run the following command to install the latest installation package for Linux ARM64:
curl https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-arm64.tgz -o aliyun-cli-linux-latest.tgz
Download an earlier version of the installation package: Visit GitHub Release and select a version. The name of installation packages for Linux is in the following format:
aliyun-cli-linux-<version>-<architecture>.tgz
.
In the directory of the installation package, run the following command to decompress the installation package and obtain the executable file
aliyun
:tar xzvf aliyun-cli-linux-latest.tgz
Run the following command to move the executable file to the
/usr/local/bin
directory to ensure that Alibaba Cloud CLI is globally callable:sudo mv ./aliyun /usr/local/bin/
Check whether Alibaba Cloud CLI is installed
Run the following command to check whether Alibaba Cloud CLI is installed:
aliyun version
If the system displays a version number of Alibaba Cloud CLI similar to the following example, Alibaba Cloud CLI is installed.
3.0.277