cannot install winehq-stable due to broken packages on 20.04 upgraded from 18.04

I found this article Unable to install wine32 due to broken packages but this is not quite the end of the story for me.

After digging down the dependency trees it seems that the underlying cause were older gcc-11 installation on the predecessor 18.04 holding essentials libraries.

The following packages have unmet dependencies:
 libgcc-s1 : Breaks: libgcc-s1:i386 (!= 11.1.0-1ubuntu1~18.04.1) but 10.3.0-1ubuntu1~20.04 is to be installed
 libgcc-s1:i386 : Breaks: libgcc-s1 (!= 10.3.0-1ubuntu1~20.04) but 11.1.0-1ubuntu1~18.04.1 is to be installed

So how on earth am i going to replace the libgcc with the right version?
Trying to remove the libgcc-s1 package is not an option as everything depends on it.


Eventually I made some progress by downgrading some libs with the correct ubuntu-20.04 versions

apt install libgcc-s1=10.3.0-1ubuntu1~20.04
apt install libstdc++6=10.3.0-1ubuntu1~20.04

However, this was only a fraction on the path to get the wine installation working as I could see by further examination of the dependency conflicts of winehq-stable.
Based on this my next step was a brute force approach which would remove all 18.04 versions:

apt remove $(dpkg -l | grep  \~18.04 | grep ii | awk '{ print $2}')

However, this also removed half the system including the nvidia-driver!
I had to reinstall the video and the desktop next before any reboot (and some lost AV software):

apt install nvidia-driver-470
apt install ubuntustudio-desktop
apt install clementine mixxx vlc

and finally it worked: apt install winehq-stable

What a bloody mission!

this only happened because i really needed wine to run my tax software and I had a deadline ;)