apk3: a way to pin a package in place upon installation
i'm currently trying to come up with a robust approach to handle kernel packages - i need old kernels to stick around so that people have something to revert to when updating - right now i'm having kernels have a pre-upgrade hook which backs things up and then restores things in place afterwards, but i don't like this approach much (it breaks atomicity and isn't exactly robust)
so i considered the idea of versioning the pkgnames (i.e. instead of linux-lts
the package name would be e.g. linux-lts-6.6.6-0-generic
- this would ensure that a kernel update is just a new package to install, and pruning old kernels would not need a dedicated tool, but rather would be just standard package management
however, we currently have no way to actually pin the package in place after installation, so this is not implementable; it's not realistic to require users to add every kernel's explicitly versioned name into world, so maybe a feature could be added to aid this?
ideally we'd have a kernel package with a versioned name (e.g. linux-lts-6.6.6-0-generic
) depended on by a package with an unversioned name (linux-lts
); the unversioned name is what one would use for initial installation, and that would:
- depend on the latest versioned name
- that would somehow pin the versioned name in place
- newer version of the kernel with same provider would result in a standard upgrade by the dependency being switched, however the old package would not get purged, and the new version would get pinned again (with its full versioned name)
- purging old versions would be a simple
apk del
, with a full choice of what would get purged
there are probably other non-kernel cases where such mechanism would help too
or perhaps somebody has an idea how to implement this or equivalent mechanism without requiring new features?
ref #10887