Dealing with packages which provide the same dependency
There are a lot of problems when it comes to packages which provide=x, where x is the same provided dependency between two packages
For example
pulseaudio
and pipewire-pulse
(both of them provide pulseaudio
)
If you try to apk del pipewire-pulse
and there are packages which depend on pulseaudio
, and it won't be removed (and that's to be expected)
But when you try to apk add pulseaudio
to install regular pulseaudio, it will not be installed. Instead, it assumes you already have pulseaudio
installed in the form of pipewire-pulse
, and so it does nothing.
Another case where this has happened to me: wine
and wine-staging
Both wine
and wine-staging
provide wine
. winetricks
depends on wine
, and works with both wine and wine-staging, regardless of their version. Similarly, if you apk del wine-staging
in a system with winetricks
and then apk add wine
, nothing happens because it's "already installed"
This also affects apk fetch
functionality. In a system with wine-staging, apk fetch wine
downloads wine-staging
As a workaround you can apk upgrade --available
or apk add '!wine-staging'
. But I'm sorry but it's not obvious at all, especially use of exclamation mark. Some shells have reserved usage for it unless you quote it, which again, makes it weird and it should stay as a workaround.
Instances where this has already happened:
- https://gitlab.com/postmarketOS/pmaports/-/issues/1067
- and then again https://gitlab.com/postmarketOS/pmaports/-/issues/1386 (Fixed by https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2890)
My proposed solution
Removing a package y
from world which provides=x
(regardless whenever there are packages in the system which depend on x
) via apk del y
and then installing x
via apk add x
will replace y
with x
. It just seems logically correct.
Additionally you can make --interactive ask which version of the package to install when both provide x
I hope you understand my frustration and will address this issue.