pkg
pkg copied to clipboard
[feature suggestion] pkg should preserve packages that it deletes temporaily when they are not currently available in the binary package database
Problem description
At the moment chromium is not available as a binary package on 14 amd64 for some transient reason.
While installing some other packages pkg temporarily removed chromium, and then failed to reinstall it because it isn't currently available.
As a result chromium disappeared on this system while some unrelated packages were installed or updated.
Chromium is a particularly important package because it is a major web browser, and removing such package without user intent causes problems for users. An important package disappears during a seemingly unrelated operation without an obvious reason.
Feature suggestion
When some software package should be temporarily uninstalled and it isn't available in the package DB - pkg should:
- create or offer the user to create a binary package for this software package from its installed version
- use this binary package to reinstall this software, or offer the user to reinstall it.
pkg already does that the packages are in the cache directory so one can manually install it via pkg install /var/cache/pkg/chromium
This would require saving all of the old dependencies as well. At some level, package or shlib files. This behavior has bitten me plenty. People have asked for similar fix to Poudriere but the same problems exist with dependencies. Smarter fat packages could solve this but I don't see that happening.
@bapt
Packages are places into /var/cache/pkg when they are originally installed with pkg, and not when they are installed by building from a port.
This cache was cleaned at some point for unrelated reasons, and the file wasn't there.
So I suggest that /var/cache/pkg/{name}.xxx is created in the case when: (1) it needs to be removed (2) it isn't in /var/cache/pkg (3) it isn't in the binary package DB
True, some dependency might be different, etc., but in the current specific case I reinstalled chromium by creating a binary package from the file system backup from 2-3 days ago and it works fine. In case when that backup wouldn't have been available - I wouldn't be able to use chromium for many hours until it would rebuild.
I believe this is a real problem for regular users that an important package can just disappear like this.