如何在 alpine linux 上运行 pstree?

如何在 alpine linux 上运行 pstree?

我可以在 alpine linux 上以树的形式查看进程列表吗?我尝试使用 apk add,但它给出了一个关于无法满足的约束的错误。这个错误没什么帮助 :-(

/ # apk search pstools
WARNING: Ignoring APKINDEX.84815163.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.24d64ab1.tar.gz: No such file or directory

/ # apk search ps
WARNING: Ignoring APKINDEX.84815163.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.24d64ab1.tar.gz: No such file or directory

/ # apk add pstree
WARNING: Ignoring APKINDEX.84815163.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.24d64ab1.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
  pstree (missing):
    required by: world[pstree]

感谢您的阅读。

答案1

以下命令对我有帮助:

/#     apk update 
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
v3.6.3-58-g8a2e635d73 [http://dl-cdn.alpinelinux.org/alpine/v3.6/main]
v3.6.3-57-gfd0de89d0b [http://dl-cdn.alpinelinux.org/alpine/v3.6/community]
OK: 8448 distinct packages available

/ #    apk add pstree
(1/1) Installing pstree (2.39-r0)
Executing busybox-1.26.2-r5.trigger
OK: 35 MiB in 27 packages

相关内容