NelloKudo / osu-winello

osu! stable installer for Linux with patched wine-osu and other nice features 8)
GNU General Public License v3.0
297 stars 13 forks source link

Immutable versions of Fedora (also known as CoreOS) aren't that good with package redeclarations #78

Closed kurtbahartr closed 1 month ago

kurtbahartr commented 2 months ago

So I wanted to use osu-winello on Bazzite, a Universal Blue project based on Fedora Atomic Desktops (Fedora Silverblue and Fedora Kinoite), and since the installation script doesn't check for the presence of rpm-ostree and jumps straight into usage of dnf, which is mapped as a wrapper for rpm-ostree on immutable versions, I get the following error because some, or all, of these packages are already installed;

error: "zstd" is already provided by: zstd-1.5.6-1.fc40.x86_64. Use --allow-inactive to explicitly require it.

Checking for the presence of rpm-ostree and using that instead along with the flag --allow-inactive could be a hacky, lazy but more global and the least energy consuming way of mitigating this issue.

Another way could be writing out what packages we tried to install when it failed and asking user to do manual intervention and then rerun the script with --no-deps since we should already have the dependencies installed by then. However, this would be pretty problematic for someone who jumped into Linux without knowing much about the package managers.

One other yet the most efficient and the most unattended way could be checking one file installed by each of the packages respectively and installing what's missing only. For example, that would be /usr/bin/zenity for zenity.

There's another thing to keep in mind about such distros: Every package installed by rpm-ostree are "overlay packages"/"mutations" so the system has to be restarted completely for these packages to be available. Fedora does provide a way to save you from the reboot with the command rpm-ostree apply-live, which has to run as root. What this command does is basically applying the changes systematically and in a simple way on top of your current session if rebooting would be a waste of time at that moment. Of course this won't work if there are packages to be upgraded with the next reboot and there's no --allow-replacement flag supplied.

NelloKudo commented 1 month ago

I'll look into Bazzite and try to fix then. Thanks for the various suggestions, I guess the hacky way'd be good enough to fix it (?)

kurtbahartr commented 1 month ago

You don't explicitly need Bazzite for that. Even Fedora Silverblue/Kinoite itself suffices. And you're welcome, yeah the hacky way should do for now.

NelloKudo commented 1 month ago

Tried with this approach: immagine

But here's the result :/ I believe they're installing fine but need a reboot to work properly as 7z isn't found later on in the script. immagine

kurtbahartr commented 1 month ago

Hmm yeah the apply-live function isn't that great when --allow-inactive flag is used in install. Though the requirement to reboot is the caveat of being immutable - You're effectively switching "commits" between reboots, the latest commit being the one you boot into.

EDIT: I think I have an idea but it's still far too complicated: Try to proceed anyway and when a command fails and the script detects an immutable distro, ask the user to perform a reboot and rerun the script. It's like "Hey I failed to do this action. Maybe a reboot can help mitigate this somehow?".

kurtbahartr commented 1 month ago

After some back and forth over on Discord, the issue has finally been resolved. Thanks for the cooperation and attention Nello!