Alpine apk:列出所有可用的包版本

For*_*vin 13 linux bash package alpine-linux

如何在 Alpine Linux 上列出给定软件包的所有可用软件包版本?

我在 apk 帮助中找不到任何有用的东西。

apk info bash 只显示最新的可用 bash 版本。

# apk info bash
bash-5.0.0-r0 description:
The GNU Bourne Again shell

bash-5.0.0-r0 webpage:
https://www.gnu.org/software/bash/bash.html

bash-5.0.0-r0 installed size:
1200128
Run Code Online (Sandbox Code Playgroud)

使用该--all标志,我只能获得该版本的一些附加信息:

# apk info --all bash
bash-5.0.0-r0 description:
The GNU Bourne Again shell

bash-5.0.0-r0 webpage:
https://www.gnu.org/software/bash/bash.html

bash-5.0.0-r0 installed size:
1200128

bash-5.0.0-r0 depends on:
/bin/sh
so:libc.musl-x86_64.so.1
so:libreadline.so.8

bash-5.0.0-r0 provides:
cmd:bash

bash-5.0.0-r0 has auto-install rule:

bash-5.0.0-r0 license:
GPL-3.0-or-later
Run Code Online (Sandbox Code Playgroud)

apk list并且apk list --available只列出最新版本的所有可用包。
所以如果我运行apk list -a | grep "^bash-\d",我只会得到这个:

# apk list -a | grep "^bash-\d"
bash-5.0.0-r0 x86_64 {bash} (GPL-3.0-or-later)
Run Code Online (Sandbox Code Playgroud)

Adi*_*iii 5

例如,该命令列出了最新分支的信息以及不同分支中的 Alpine 管理包版本v3.5, v3.6.... v3.10

可以apk utility从多个存储库安装软件包。要检查的存储库列表存储在 /etc/apk/repositories 中,每行一个存储库。

您可以在这里搜索版本

https://pkgs.alpinelinux.org/packages?name=bash&branch=v3.5

或者

https://pkgs.alpinelinux.org/packages

因此,如果您有兴趣添加版本,bash4.3则应在添加旧版本或来自其他分支而不是最新版本时告知分支名称。

apk add  --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/main/ bash=4.3.46-r5
Run Code Online (Sandbox Code Playgroud)

所以如果你跑

apk add  --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/main/ && apk info bash
Run Code Online (Sandbox Code Playgroud)

您将从两个不同的分支获取版本信息。

The GNU Bourne Again shell

bash-4.3.46-r5 webpage:
http://www.gnu.org/software/bash/bash.html

bash-4.3.46-r5 installed size:
700416

bash-5.0.0-r0 description:
The GNU Bourne Again shell

bash-5.0.0-r0 webpage:
https://www.gnu.org/software/bash/bash.html

bash-5.0.0-r0 installed size:
1200128
Run Code Online (Sandbox Code Playgroud)