https://bugs.winehq.org/show_bug.cgi?id=52439
--- Comment #9 from jkfloris@dds.nl --- I think it is most convenient for the end user to have one manual that works everywhere. The following approach works on Debian Buster, Bullseye and Bookworm and I expect that it should not cause any problems on Ubuntu either.
Download and install the key: wget -nc https://dl.winehq.org/wine-builds/winehq.key sudo mv winehq.key /usr/share/keyrings/winehq-archive.key
Download and install the sources file for your distro, for example bookworm wget -nc https://dl.winehq.org/wine-builds/winehq-bookworm.sources sudo mv winehq-bookworm.sources /etc/apt/sources.list.d/
Where winehq-bookworm.sources contains the following: ---
Types: deb URIs: https://dl.winehq.org/wine-builds/debian Suites: bookworm Components: main Architectures: amd64 i386 Signed-By: /usr/share/keyrings/winehq-archive.key
--- Unfortunately, as far as I know, no variables can be used in a sources file, otherwise one file for all Debian/ Ubuntu versions would have been possible.