logoalt Hacker News

WhyNotHugoyesterday at 5:33 PM1 replyview on HN

apk uses a similar approach by default, and I think it's a wonderful way for a package manager to operate.

Basically, /etc/apk/world keeps a list of explicitly installed packages.

When you manually install a package, it's added to this list, when you manually remove a package, it's removed from the list.

Installation and upgrading (and "fixing) merely ensures that those packages and their dependencies are installed, no more, no less. This also automatically cleans up stale, unused dependencies.

It's a lovely way to get deterministic results. You can just back-up that world file, or copy it to another machine and get the exact same installation.


Replies

creshalyesterday at 6:10 PM

apt-mark manual has allowed the same functionality in apt since forever and probably inspired apk's copy of it :)