3

Is it possible to list packages directly installed by apk add? e.g. apk add docker, apk add lm-sensors file, etc.

Running apk info lists ALL installed packages (including dependencies of installed packages), but I want to narrow this list down to top-level packages that are not dependencies of other packages in order to reproduce these packages on another system.

2 Answers2

3

A list should be automatically generated and available at /etc/apk/world. See apk-world(5):

At /etc/apk/world, apk maintains the world, or list of explicitly
installed packages. This is a plaintext file with one package spec per
line.

thiagowfx
  • 137
  • 4
1

You're using the wrong tool.

You should use lbu to generate a package list or better yet an overlay file which you can use to bring an Alpine Linux system to a known set of packages.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940