具体来说,我想找出必须安装哪些软件包才能在disown
基于 Alpine Linux 的 docker 中获取命令?此外,如果有人能告诉我一般情况下应该如何寻找丢失的命令(以及它们在什么包中),那就太好了,这样我就不必带着每个命令来到这里。
答案1
答案2
如果您想以脚本方式使用 pkgs.alpinelinux.org,您可以在您的发行版中添加 html2text(对于 Alpine:apk 添加 html2text)并使用我 10 分钟前完成的脚本...:)
#!/bin/sh
file=$1
arch=${2:-x86_64}
branch=${3:-edge}
valid_branch="v3.3 v3.4 v3.5 v3.6 v3.7 v3.8 v3.9 v3.10 edge all"
valid_arch="armv7 s390x ppc64le armhf aarch64 x86 x86_64 all"
usage() {
echo -e "\nUsage: $0 <pattern> [arch] [branch]\n"
echo -e "\t<pattern>: Mandatory. Is the file you are searching. Supports wildcards (e.g. wge*) "
echo -e "\t[arch]: Optional (default: x86_64). Architecture. Valid values: $valid_arch"
echo -e "\t[branch]: Optional (default: edge). Alpine releases. Valid values: $valid_branch\n"
exit 1;
}
query() {
curl -s -d"$1" -H "application/x-www-form-urlencoded" -X GET https://pkgs.alpinelinux.org/contents | sed "s///\//g" | html2text -nobs -ascii | sed /^$/d | sed '1d' | awk /^File/,/*Copy*/ |grep -vE 'Privacy|Policy'
}
if ! [ $file ] ; then usage; fi
echo $valid_arch | grep -qi $arch || ( echo "Invalid arch. Valid values are: $valid_arch"; exit 1 )
echo $valid_branch | grep -qi $branch || ( echo "Invalid branch. Valid values are: $valid_branch"; exit 1 )
if [ $branch == "all" ]; then
if [ $arch == "all" ]; then
for b in $valid_branch; do
query "branch=$b&file=$file"
done
else
for b in $valid_branch; do
query "branch=$b&file=$file&arch=$arch"
done
fi
else
query "branch=$branch&file=$file&arch=$arch"
fi
2022 年 4 月 7 日更新
您可以在以下位置找到此脚本https://github.com/fcolista/apkfile