无法从 Alpine 上的边缘存储库安装 aws-cli linux

Cannot install aws-cli from edge repository on Alpine linux

我正在尝试从边缘存储库安装 aws-cli,但我无法

https://pkgs.alpinelinux.org/package/edge/community/x86_64/aws-cli

OS版本有问题吗? ( 3.11 / 3.12 )

如果是,是否有解决方法?

root@6f97c6559fe9:/ # echo http://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories 
root@6f97c6559fe9:/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
v3.11.6-71-gb45d3b45cc [http://dl-cdn.alpinelinux.org/alpine/v3.11/main]
v3.11.6-68-gf6abc2afac [http://dl-cdn.alpinelinux.org/alpine/v3.11/community]
v3.12.0-442-g76e377ea0b [http://dl-cdn.alpinelinux.org/alpine/edge/main]
OK: 16123 distinct packages available

root@6f97c6559fe9:/ # apk add aws-cli
ERROR: unsatisfiable constraints:
  aws-cli (missing):
    required by: world[aws-cli]
root@6f97c6559fe9:/ # apk add --update aws-cli
ERROR: unsatisfiable constraints:
  aws-cli (missing):
    required by: world[aws-cli]

root@6f97c6559fe9:/ # cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.3
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

所以 Alpine 的 package page 似乎证实 aws-cli 确实不是 Alpine 3.11 包存储库的一部分。

也就是说,您可以使用 AWS 自己的一套说明安装它,您只需要 curlpython 即可。

对于 AWS CLI v1:

apk add python curl
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

来源:https://docs.aws.amazon.com/cli/latest/userguide/install-linux.html#install-linux-bundled

遗憾的是,对于 AWS CLI v2,似乎尚不支持 Alpine:

nateprewitt commented on 24 Feb
Hi @firstval, it looks like you found a response on this behavior in #4685. We're currently tracking Docker support in #3553 which would be a prerequisite for this to work.

That said, we can definitely do better with the exceptions being returned. We're working on getting a warning in our install script to will alert you when the platform isn't supported.

We'll track the remaining piece for alpine support in #3553. Thanks!

来源:https://github.com/aws/aws-cli/issues/4971

再往下 #3553

这也可以解释为什么即使在 Alpine 3.12 上,实际的软件包安装版本 1.xx 而不是 2.xx 版本。