How to get out of Wine Dependency hell

PLEASE NOTE: THIS GUIDE IS UPDATED REGULARLY AS PER FEEDBACK FROM MY YOUTUBE VIDEOS. IT SHOULD ALWAYS BE RELEVANT.

How to get out of Wine Dependency hell (aka I just installed Lutris to run wine games and *forgot* to install everything wine related):

Preface (You can skip this to the instructions below if you don’t need an explanation):

Dependencies are libraries and programs that another program needs in order to be able to run and/or be compiled. This is why binary pre-compiled blobs are bad and why many people choose to use compile-friendly distros like Arch, Gentoo, OpenSUSE and the like. When you compile something, it uses the libraries found natively on your system, and you know what’s being used to build the program in addition to the option to view/modify/patch the code.

Example –

Say I’m on Ubuntu, right? Let’s say I have all the libraries I need for Wine. So I compile wine into a binary blob package and put it on a ppa for people to use. Here’s the problem — many of wines libraries are marked as optional.
So I could have libraries I built with that you dont have. Also let’s say its not marked as a dependency on my binary blob package. So you install the package, your game keeps crashing, and you’re like what the hell?? Turns out you don’t have all the libraries it needs, or a version of the libraries I used is different from the ones on your system. There’s no way to tell that though because i didnt put them in the package dependency requirements, and wine lists them as optional.

Look at depends, makedepends, and optdepends. You literally want ALL of those installed before compiling+installing wine. A binary blob package isn’t gonna tell you that unless the person who made the package specified it. The Arch PKGBUILD above was made by a user, who was kind enough to tell other users everything necessary to build and run the program.

Runtimes –

Some programs come with their own set of “runtimes” – their own versions of libraries, in order to remedy this problem. Lutris does it, Steam does it, as well as many games.

Example –

What the lutris runtimes do is it makes lutris use a copy of the “runtime” libraries packaged with lutris that they used to compile their “runners” – versions of wine. Steam does something very similar with Ubuntu runtimes. Sometimes however, even then there can be version problems but for the most part it works.

So why do I want to install all the packages if runtimes are available? Ideally it’s better to have native libraries than using pre-shipped runtimes because your system knows how to use them as opposed to runtimes that were again – built on another system. This comes down to versioning.

Versioning –

Say I have a game that crashes using the library glibc 2.x but works on 2.y. That glibc may not crash all games, but it crashes this one. So I find out my system has glibc 2.y.. Great! Yay! So I’d want to disable the runtimes because the ones packaged came with 2.x. This is where the trouble starts. If i dont have -all- the libraries I need – I face possible crashes due to other missing libraries because my system doesn’t have all the library dependencies – hence I am officially in Wine Dependency hell.

Summary:
Install all the wine dependencies on your system natively, disable runtimes when possible so that the program doesnt rely on it’s own runtimes, and only use runtimes selectively when needed.

if there is any one man in the world who deserves to be called glorious, it must be you!!

Thank you VERY MUCH indeed, you saved my day, my weekend, my life. I had big trouble installing some German tax software, ELSTER, with Linux, due to problems with WINE, PlayOnLinux, Windtricks, Updates therein, and the like. It was horrible, searching for the mistake for hours and hours, all in vain.

Somehow I must have carried out the right updates so, hopefully, as I finally stumbled the information that some library packages in Linux might be missing – lib and lib and winehqstaging.
I do not even know in what connection I really came to your site for 🙂 – but I did the steps you proposed for Ubuntu, and reinstalled ELSTER – and now, only now it seems to be working!

Gentoo will automatically pull in the dependencies you need for the app-emulation/wine-* Wine packages, for the given USE flags you have specified.
So I’m not sure a Gentoo guide is warranted really. Third party stuff, like setting up your Vulkan layer, are described well enough here: https://github.com/lutris/lutris/wiki/How-to:-DXVK